diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-12-11 13:31:27 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-12-12 11:15:30 -0900 |
commit | 5d4a490d93964f5f95a0053bbf70845f554826bc (patch) | |
tree | 2c59bfd485a3ca5b6196b71a33d9363834df31a1 | |
parent | 84356a3b1bbb851c5c31e4ccab4ebe0479722a29 (diff) |
block: add sysfs entry for fua support
-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 f87a7e747d36..51ebb09fa4e5 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -379,6 +379,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); @@ -521,6 +526,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, @@ -552,6 +562,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, NULL, }; |