summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/region_devs.c
diff options
context:
space:
mode:
authorPankaj Gupta <pagupta@redhat.com>2019-07-05 19:33:24 +0530
committerDan Williams <dan.j.williams@intel.com>2019-07-05 15:19:10 -0700
commitfefc1d97fa4b5e016bbe15447dc3edcd9e1bcb9f (patch)
treef18d110c2fdc771ca69ea6a83399f0c13f758664 /drivers/nvdimm/region_devs.c
parent6e84200c0a2994b991259d19450eee561029bf70 (diff)
downloadlinux-fefc1d97fa4b5e016bbe15447dc3edcd9e1bcb9f.tar.bz2
libnvdimm: add dax_dev sync flag
This patch adds 'DAXDEV_SYNC' flag which is set for nd_region doing synchronous flush. This later is used to disable MAP_SYNC functionality for ext4 & xfs filesystem for devices don't support synchronous flush. Signed-off-by: Pankaj Gupta <pagupta@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/region_devs.c')
-rw-r--r--drivers/nvdimm/region_devs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c
index eca2e62af134..56f2227f192a 100644
--- a/drivers/nvdimm/region_devs.c
+++ b/drivers/nvdimm/region_devs.c
@@ -1211,6 +1211,13 @@ int nvdimm_has_cache(struct nd_region *nd_region)
}
EXPORT_SYMBOL_GPL(nvdimm_has_cache);
+bool is_nvdimm_sync(struct nd_region *nd_region)
+{
+ return is_nd_pmem(&nd_region->dev) &&
+ !test_bit(ND_REGION_ASYNC, &nd_region->flags);
+}
+EXPORT_SYMBOL_GPL(is_nvdimm_sync);
+
struct conflict_context {
struct nd_region *nd_region;
resource_size_t start, size;