aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigal Korman <yigal@plexistor.com>2016-06-23 14:49:32 -0400
committerMike Snitzer <snitzer@redhat.com>2016-07-20 12:43:37 -0400
commit51d1a5abcd0e88cb4528f35643245ea59cf234f1 (patch)
treea56f65c4fd8018a6a6d1d9965c133c55c1d8c3b6
parent6c00531c6affa42b165df73a1eac3289bc45f4c4 (diff)
downloadlinux-dm-51d1a5abcd0e88cb4528f35643245ea59cf234f1.tar.gz
block: expose QUEUE_FLAG_DAX in sysfs
Notice: this object is not reachable from any branch.
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>
Notice: this object is not reachable from any branch.
-rw-r--r--block/blk-sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 99205965f5596..f87a7e747d360 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_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 = {
.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
.show = queue_requests_show,
@@ -516,6 +521,11 @@ static struct queue_sysfs_entry queue_wc_entry = {
.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[] = {
&queue_requests_entry.attr,
&queue_ra_entry.attr,
@@ -542,6 +552,7 @@ static struct attribute *default_attrs[] = {
&queue_random_entry.attr,
&queue_poll_entry.attr,
&queue_wc_entry.attr,
+ &queue_dax_entry.attr,
NULL,
};