diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2008-01-29 19:14:08 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-01-29 21:55:17 +0100 |
commit | e68b903c6b2b88c60050675b056648468f33ab54 (patch) | |
tree | 6622d232adae87af15a9e42e024b513012e59d2b /block/blk-sysfs.c | |
parent | 7da975a231ae8c11593fd79d1083215321be213a (diff) |
Expose hardware sector size
Expose hardware sector size in sysfs queue directory.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index d9b9afab345..bc28776ba76 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -102,6 +102,11 @@ static ssize_t queue_max_sectors_show(struct request_queue *q, char *page) return queue_var_show(max_sectors_kb, (page)); } +static ssize_t queue_hw_sector_size_show(struct request_queue *q, char *page) +{ + return queue_var_show(q->hardsect_size, page); +} + static ssize_t queue_max_sectors_store(struct request_queue *q, const char *page, size_t count) { @@ -160,12 +165,18 @@ static struct queue_sysfs_entry queue_iosched_entry = { .store = elv_iosched_store, }; +static struct queue_sysfs_entry queue_hw_sector_size_entry = { + .attr = {.name = "hw_sector_size", .mode = S_IRUGO }, + .show = queue_hw_sector_size_show, +}; + static struct attribute *default_attrs[] = { &queue_requests_entry.attr, &queue_ra_entry.attr, &queue_max_hw_sectors_entry.attr, &queue_max_sectors_entry.attr, &queue_iosched_entry.attr, + &queue_hw_sector_size_entry.attr, NULL, }; |