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

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.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---

v2: update commit message with suggestion from Dan.

 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

* Re: [PATCH v2] dax: allow MAP_SYNC for device-dax mmap() to succeed
  2018-04-19 20:39 [PATCH v2] dax: allow MAP_SYNC for device-dax mmap() to succeed Dave Jiang
@ 2018-04-19 21:08 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2018-04-19 21:08 UTC (permalink / raw)
  To: Dave Jiang; +Cc: linux-nvdimm

On Thu, Apr 19, 2018 at 1:39 PM, Dave Jiang <dave.jiang@intel.com> wrote:
> 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.
>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>
> v2: update commit message with suggestion from Dan.

Looks good,

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 20:39 [PATCH v2] dax: allow MAP_SYNC for device-dax mmap() to succeed Dave Jiang
2018-04-19 21:08 ` 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).