nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] dax: allowing MAP_SYNC for device-dax mmap() to succeed
@ 2018-04-19 18:22 Dave Jiang
  2018-04-19 20:32 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2018-04-19 18:22 UTC (permalink / raw)
  To: dan.j.williams; +Cc: linux-nvdimm

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.jiang@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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-19 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 18:22 [PATCH] dax: allowing MAP_SYNC for device-dax mmap() to succeed Dave Jiang
2018-04-19 20:32 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).