drbd/0023-drbd-move-flags-to-queue_limits.patch
2025-01-08 07:34:16 +00:00

54 lines
1.8 KiB
Diff

From ac4e2f85066d2da306ec0e3fed8db4e945be6f6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christoph=20B=C3=B6hmwalder?=
<christoph.boehmwalder@linbit.com>
Date: Thu, 5 Sep 2024 13:03:07 +0200
Subject: [PATCH 23/32] drbd: move flags to queue_limits
Roughly equivalent to the following commits from upstream Linux:
1122c0c1 block: move cache control settings out of queue->flags
bd4a633b block: move the nonrot flag to queue_limits
1a02f3a7 block: move the stable_writes flag to queue_limits
---
drbd/drbd_main.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
index 2792b9896271..407b0a1d1773 100644
--- a/drbd/drbd_main.c
+++ b/drbd/drbd_main.c
@@ -3886,6 +3886,11 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
int vnr = adm_ctx->volume;
enum drbd_ret_code err = ERR_NOMEM;
bool locked = false;
+ struct queue_limits lim = {
+ .features = BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA |
+ BLK_FEAT_ROTATIONAL |
+ BLK_FEAT_STABLE_WRITES,
+ };
lockdep_assert_held(&resource->conf_update);
@@ -3948,7 +3953,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
init_rwsem(&device->uuid_sem);
- disk = blk_alloc_disk(NULL, NUMA_NO_NODE);
+ disk = blk_alloc_disk(&lim, NUMA_NO_NODE);
if (IS_ERR(disk)) {
err = PTR_ERR(disk);
goto out_no_disk;
@@ -3967,9 +3972,6 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig
sprintf(disk->disk_name, "drbd%d", minor);
disk->private_data = device;
- blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
- blk_queue_write_cache(disk->queue, true, true);
-
device->md_io.page = alloc_page(GFP_KERNEL);
if (!device->md_io.page)
goto out_no_io_page;
--
2.35.3