diff options
author | Yigal Korman <yigal@plexistor.com> | 2016-06-23 17:05:51 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-20 23:01:08 -0400 |
commit | ea6ca600eb90350259cee5514e97b91ad1bc1aa5 (patch) | |
tree | 9dc83459ff157e16ad1951c11bfaaec6452dd5e1 | |
parent | 163d4baaebe39c0e56d9c08597eab7b3ae0bf334 (diff) |
block: expose QUEUE_FLAG_DAX in sysfs
Provides the ability to identify DAX enabled devices in userspace.
Signed-off-by: Yigal Korman <yigal@plexistor.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
-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 99205965f559..f87a7e747d36 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, | |||
379 | return count; | 379 | return count; |
380 | } | 380 | } |
381 | 381 | ||
382 | static ssize_t queue_dax_show(struct request_queue *q, char *page) | ||
383 | { | ||
384 | return queue_var_show(blk_queue_dax(q), page); | ||
385 | } | ||
386 | |||
382 | static struct queue_sysfs_entry queue_requests_entry = { | 387 | static struct queue_sysfs_entry queue_requests_entry = { |
383 | .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, | 388 | .attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR }, |
384 | .show = queue_requests_show, | 389 | .show = queue_requests_show, |
@@ -516,6 +521,11 @@ static struct queue_sysfs_entry queue_wc_entry = { | |||
516 | .store = queue_wc_store, | 521 | .store = queue_wc_store, |
517 | }; | 522 | }; |
518 | 523 | ||
524 | static struct queue_sysfs_entry queue_dax_entry = { | ||
525 | .attr = {.name = "dax", .mode = S_IRUGO }, | ||
526 | .show = queue_dax_show, | ||
527 | }; | ||
528 | |||
519 | static struct attribute *default_attrs[] = { | 529 | static struct attribute *default_attrs[] = { |
520 | &queue_requests_entry.attr, | 530 | &queue_requests_entry.attr, |
521 | &queue_ra_entry.attr, | 531 | &queue_ra_entry.attr, |
@@ -542,6 +552,7 @@ static struct attribute *default_attrs[] = { | |||
542 | &queue_random_entry.attr, | 552 | &queue_random_entry.attr, |
543 | &queue_poll_entry.attr, | 553 | &queue_poll_entry.attr, |
544 | &queue_wc_entry.attr, | 554 | &queue_wc_entry.attr, |
555 | &queue_dax_entry.attr, | ||
545 | NULL, | 556 | NULL, |
546 | }; | 557 | }; |
547 | 558 | ||