summaryrefslogtreecommitdiffstats
path: root/drivers/dax
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2018-04-19 22:39:43 +0200
committerDan Williams <dan.j.williams@intel.com>2018-04-20 00:11:50 +0200
commitef8423022324cf79bd1b41d8707c766461e7e555 (patch)
treeb8e9e4cf41c1aa3bc463512d83f9182ec93419ad /drivers/dax
parentRevert "libnvdimm, of_pmem: workaround OF_NUMA=n build error" (diff)
downloadlinux-ef8423022324cf79bd1b41d8707c766461e7e555.tar.xz
linux-ef8423022324cf79bd1b41d8707c766461e7e555.zip
device-dax: allow MAP_SYNC to succeed
MAP_SYNC is a nop for device-dax. Allow MAP_SYNC to succeed on device-dax to eliminate special casing between device-dax and fs-dax as to when the flag can be specified. Device-dax users already implicitly assume that they do not need to call fsync(), and this enables them to explicitly check for this capability. Cc: <stable@vger.kernel.org> Fixes: b6fb293f2497 ("mm: Define MAP_SYNC and VM_SYNC flags") Signed-off-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax')
-rw-r--r--drivers/dax/device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index be8606457f27..aff2c1594220 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -19,6 +19,7 @@
#include <linux/dax.h>
#include <linux/fs.h>
#include <linux/mm.h>
+#include <linux/mman.h>
#include "dax-private.h"
#include "dax.h"
@@ -540,6 +541,7 @@ static const struct file_operations dax_fops = {
.release = dax_release,
.get_unmapped_area = dax_get_unmapped_area,
.mmap = dax_mmap,
+ .mmap_supported_flags = MAP_SYNC,
};
static void dev_dax_release(struct device *dev)