Skip to content

Commit

Permalink
block: Add sysfs entry for fua support
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Overstreet <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
koverstreet authored and axboe committed May 14, 2018
1 parent 1900fcc commit 6fcefbe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6fcefbe

Please sign in to comment.