For NVMe, we use the logical block size. For physical block size, that canI highly suspect it is wrong to use logical block size as minimum
be greater than the logical block size for npwg set, and I don't think it's
suitable use that as minimum atomic write unit.
support atomic write unit, given physical block size is supposed to
be the minimum atomic write unit.
Anyway, I am not too keen on sanitizing this value in this way.Relying on driver to provide sound value is absolutely bad design from API
Again, we rely on the driver to provide sound values. However, as mentioned,+atomic_write_unit_max_sectors should be >= atomic_write_unit_min_sectors.
+/*
+ * blk_queue_atomic_write_unit_max_sectors - largest unit that can be written
+ * atomically to the device.
+ * @q: the request queue for the device
+ * @sectors: must be a power-of-two.
+ */
+void blk_queue_atomic_write_unit_max_sectors(struct request_queue *q,
+ unsigned int sectors)
+{
+ struct queue_limits *limits = &q->limits;
+
+ limits->atomic_write_unit_max_sectors = sectors;
+}
+EXPORT_SYMBOL(blk_queue_atomic_write_unit_max_sectors);
we can sanitize.
viewpoint.