[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1466715953-40692-3-git-send-email-snitzer@redhat.com>
Date: Thu, 23 Jun 2016 17:05:51 -0400
From: Mike Snitzer <snitzer@...hat.com>
To: axboe@...nel.dk, toshi.kani@....com, dan.j.williams@...el.com
Cc: ross.zwisler@...ux.intel.com, viro@...iv.linux.org.uk,
linux-nvdimm@...1.01.org, dm-devel@...hat.com,
linux-kernel@...r.kernel.org, yigal@...xistor.com
Subject: [PATCH v3 2/4] block: expose QUEUE_FLAG_DAX in sysfs
From: Yigal Korman <yigal@...xistor.com>
Provides the ability to identify DAX enabled devices in userspace.
Signed-off-by: Yigal Korman <yigal@...xistor.com>
Signed-off-by: Toshi Kani <toshi.kani@....com>
Acked-by: Dan Williams <dan.j.williams@...el.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
---
block/blk-sysfs.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 9920596..f87a7e7 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,
};
--
2.7.4 (Apple Git-66)
Powered by blists - more mailing lists