Commit ea6ca600 authored by Yigal Korman's avatar Yigal Korman Committed by Jens Axboe

block: expose QUEUE_FLAG_DAX in sysfs

Provides the ability to identify DAX enabled devices in userspace.
Signed-off-by: default avatarYigal Korman <yigal@plexistor.com>
Signed-off-by: default avatarToshi Kani <toshi.kani@hpe.com>
Acked-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 163d4baa
...@@ -379,6 +379,11 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page, ...@@ -379,6 +379,11 @@ static ssize_t queue_wc_store(struct request_queue *q, const char *page,
return count; return count;
} }
static ssize_t queue_dax_show(struct request_queue *q, char *page)
{
return queue_var_show(blk_queue_dax(q), page);
}
static struct queue_sysfs_entry queue_requests_entry = { static struct queue_sysfs_entry queue_requests_entry = {
.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
.show = queue_requests_show, .show = queue_requests_show,
...@@ -516,6 +521,11 @@ static struct queue_sysfs_entry queue_wc_entry = { ...@@ -516,6 +521,11 @@ static struct queue_sysfs_entry queue_wc_entry = {
.store = queue_wc_store, .store = queue_wc_store,
}; };
static struct queue_sysfs_entry queue_dax_entry = {
.attr = {.name = "dax", .mode = S_IRUGO },
.show = queue_dax_show,
};
static struct attribute *default_attrs[] = { static struct attribute *default_attrs[] = {
&queue_requests_entry.attr, &queue_requests_entry.attr,
&queue_ra_entry.attr, &queue_ra_entry.attr,
...@@ -542,6 +552,7 @@ static struct attribute *default_attrs[] = { ...@@ -542,6 +552,7 @@ static struct attribute *default_attrs[] = {
&queue_random_entry.attr, &queue_random_entry.attr,
&queue_poll_entry.attr, &queue_poll_entry.attr,
&queue_wc_entry.attr, &queue_wc_entry.attr,
&queue_dax_entry.attr,
NULL, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment