From: Keith Busch <kbusch@xxxxxxxxxx> Now that user space applications can make use of partial sector reads, export and document the queue attribute that indicates if the capability is supported. Signed-off-by: Keith Busch <kbusch@xxxxxxxxxx> --- Documentation/ABI/stable/sysfs-block | 9 +++++++++ block/blk-sysfs.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-block b/Documentation/ABI/stable/sysfs-block index cd14ecb3c9a5..defc056690d0 100644 --- a/Documentation/ABI/stable/sysfs-block +++ b/Documentation/ABI/stable/sysfs-block @@ -142,6 +142,15 @@ Description: Default value of this file is '1'(on). +What: /sys/block/<disk>/queue/bit_bucket +Date: June 2022 +Contact: linux-block@xxxxxxxxxxxxxxx +Description: + [RO] This file indicates if the device supports partial sector + reads. If set to '1', user space can issue direct IO reads at + dma_alignment granularity. + + What: /sys/block/<disk>/queue/chunk_sectors Date: September 2016 Contact: Hannes Reinecke <hare@xxxxxxxx> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 85ea43eff094..0c1f1c2fbb30 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -309,6 +309,7 @@ QUEUE_SYSFS_BIT_FNS(nonrot, NONROT, 1); QUEUE_SYSFS_BIT_FNS(random, ADD_RANDOM, 0); QUEUE_SYSFS_BIT_FNS(iostats, IO_STAT, 0); QUEUE_SYSFS_BIT_FNS(stable_writes, STABLE_WRITES, 0); +QUEUE_SYSFS_BIT_FNS(bit_bucket, BIT_BUCKET, 0); #undef QUEUE_SYSFS_BIT_FNS static ssize_t queue_zoned_show(struct request_queue *q, char *page) @@ -627,6 +628,7 @@ QUEUE_RW_ENTRY(queue_nonrot, "rotational"); QUEUE_RW_ENTRY(queue_iostats, "iostats"); QUEUE_RW_ENTRY(queue_random, "add_random"); QUEUE_RW_ENTRY(queue_stable_writes, "stable_writes"); +QUEUE_RW_ENTRY(queue_bit_bucket, "bit_bucket"); static struct attribute *queue_attrs[] = { &queue_requests_entry.attr, @@ -653,6 +655,7 @@ static struct attribute *queue_attrs[] = { &queue_zone_append_max_entry.attr, &queue_zone_write_granularity_entry.attr, &queue_nonrot_entry.attr, + &queue_bit_bucket_entry.attr, &queue_zoned_entry.attr, &queue_nr_zones_entry.attr, &queue_max_open_zones_entry.attr, -- 2.30.2