[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240903150748.2179966-4-john.g.garry@oracle.com>
Date: Tue, 3 Sep 2024 15:07:47 +0000
From: John Garry <john.g.garry@...cle.com>
To: axboe@...nel.dk, song@...nel.org, yukuai3@...wei.com, kbusch@...nel.org,
hch@....de, sagi@...mberg.me, James.Bottomley@...senPartnership.com,
martin.petersen@...cle.com
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-raid@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-scsi@...r.kernel.org, John Garry <john.g.garry@...cle.com>
Subject: [PATCH RFC 3/4] block: Support atomic writes limits for stacked devices
Allow stacked devices to support atomic writes by aggregating the minimum
capacility of all bottom devices.
If a bottom device does not support atomic writes, then
BLK_FEAT_ATOMIC_WRITES should be cleared for that device, and the top
device then will also not support atomic writes.
Signed-off-by: John Garry <john.g.garry@...cle.com>
---
block/blk-settings.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 036e67f73116..aeb05fb24801 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -682,6 +682,25 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
t->zone_write_granularity = 0;
t->max_zone_append_sectors = 0;
}
+ if (!(b->features & BLK_FEAT_ATOMIC_WRITES)) {
+ t->atomic_write_hw_max = 0;
+ t->atomic_write_hw_unit_max = 0;
+ t->atomic_write_hw_unit_min = 0;
+ t->atomic_write_hw_boundary = 0;
+ t->features &= ~BLK_FEAT_ATOMIC_WRITES;
+ } else if (t->features & BLK_FEAT_ATOMIC_WRITES) {
+ t->atomic_write_hw_max = min_not_zero(t->atomic_write_hw_max,
+ b->atomic_write_hw_max);
+ t->atomic_write_boundary_sectors =
+ min_not_zero(t->atomic_write_boundary_sectors,
+ b->atomic_write_boundary_sectors);
+ t->atomic_write_hw_unit_min = max(t->atomic_write_hw_unit_min,
+ b->atomic_write_hw_unit_min);
+ t->atomic_write_hw_unit_max =
+ min_not_zero(t->atomic_write_hw_unit_max,
+ b->atomic_write_hw_unit_max);
+ }
+
return ret;
}
EXPORT_SYMBOL(blk_stack_limits);
--
2.31.1
Powered by blists - more mailing lists