MAP_SYNC is basically a nop for device-dax. However allowing the MAP_SYNC
flag to succeed on device-dax would make it consistent with fs-dax and
reduces confusion for the application writer. This allows the application to
assume that it does not need to call fsync() after writes to device-dax
mappings.

Signed-off-by: Dave Jiang <dave.ji...@intel.com>
---
 drivers/dax/device.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index 37be5a306c8f..374b6718f6c5 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"
 
@@ -530,6 +531,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)

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

Reply via email to