diff options
author | Pankaj Gupta <pagupta@redhat.com> | 2019-07-05 17:03:24 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2019-07-06 01:19:10 +0300 |
commit | fefc1d97fa4b5e016bbe15447dc3edcd9e1bcb9f (patch) | |
tree | f18d110c2fdc771ca69ea6a83399f0c13f758664 /drivers/nvdimm/pmem.c | |
parent | 6e84200c0a2994b991259d19450eee561029bf70 (diff) | |
download | linux-fefc1d97fa4b5e016bbe15447dc3edcd9e1bcb9f.tar.xz |
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/pmem.c')
-rw-r--r-- | drivers/nvdimm/pmem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 223da63d1bd7..8be868e2a18b 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -376,6 +376,7 @@ static int pmem_attach_disk(struct device *dev, struct gendisk *disk; void *addr; int rc; + unsigned long flags = 0UL; pmem = devm_kzalloc(dev, sizeof(*pmem), GFP_KERNEL); if (!pmem) @@ -474,7 +475,9 @@ static int pmem_attach_disk(struct device *dev, nvdimm_badblocks_populate(nd_region, &pmem->bb, &bb_res); disk->bb = &pmem->bb; - dax_dev = alloc_dax(pmem, disk->disk_name, &pmem_dax_ops); + if (is_nvdimm_sync(nd_region)) + flags = DAXDEV_F_SYNC; + dax_dev = alloc_dax(pmem, disk->disk_name, &pmem_dax_ops, flags); if (!dax_dev) { put_disk(disk); return -ENOMEM; |