diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-08 21:33:58 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-14 13:16:17 -0600 |
commit | 6fcefbe578811bf938908e1ec43347d205133ad0 (patch) | |
tree | 3b4e659dd85c87c648f22d86663d98aa0e2e3c97 | |
parent | 1900fcc461c91a84392cd0f62381253e57c37b66 (diff) |
block: Add sysfs entry for fua support
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-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 d00d1b0ec109..cae525b7aae6 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -491,6 +491,11 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page, return count; } +static ssize_t queue_fua_show(struct request_queue *q, char *page) +{ + return sprintf(page, "%u\n", test_bit(QUEUE_FLAG_FUA, &q->queue_flags)); +} + static ssize_t queue_dax_show(struct request_queue *q, char *page) { return queue_var_show(blk_queue_dax(q), page); @@ -659,6 +664,11 @@ static struct queue_sysfs_entry queue_wc_entry = { .store = queue_wc_store, }; +static struct queue_sysfs_entry queue_fua_entry = { + .attr = {.name = "fua", .mode = S_IRUGO }, + .show = queue_fua_show, +}; + static struct queue_sysfs_entry queue_dax_entry = { .attr = {.name = "dax", .mode = S_IRUGO }, .show = queue_dax_show, @@ -708,6 +718,7 @@ static struct attribute *default_attrs[] = { &queue_random_entry.attr, &queue_poll_entry.attr, &queue_wc_entry.attr, + &queue_fua_entry.attr, &queue_dax_entry.attr, &queue_wb_lat_entry.attr, &queue_poll_delay_entry.attr, |