History

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.

Pankaj Gupta committed 7 years ago

Commit fefc1d91 parent 6e842008 files · +56 −7Browse files

Showing the changes to include/linux (2 of 8 files). Show all

Unified · Split

2 files
  1. include/linux/dax.h +22 −2
  2. include/linux/libnvdimm.h +1 −0
include/linux/dax.h+22−2
@@ -7,6 +7,9 @@ · 6 unmodified lines
77 #include <linux/radix-tree.h>
88 #include <asm/pgtable.h>
99
10+/* Flag for synchronous flush */
11+#define DAXDEV_F_SYNC (1UL << 0)
12+
1013 typedef unsigned long dax_entry_t;
1114
1215 struct iomap_ops;
@@ -38,18 +41,28 @@ extern struct attribute_group dax_attribute_group; · 25 unmodified lines
3841 #if IS_ENABLED(CONFIG_DAX)
3942 struct dax_device *dax_get_by_host(const char *host);
4043 struct dax_device *alloc_dax(void *private, const char *host,
41− const struct dax_operations *ops);
44+ const struct dax_operations *ops, unsigned long flags);
4245 void put_dax(struct dax_device *dax_dev);
4346 void kill_dax(struct dax_device *dax_dev);
4447 void dax_write_cache(struct dax_device *dax_dev, bool wc);
4548 bool dax_write_cache_enabled(struct dax_device *dax_dev);
49+bool __dax_synchronous(struct dax_device *dax_dev);
50+static inline bool dax_synchronous(struct dax_device *dax_dev)
51+{
52+ return __dax_synchronous(dax_dev);
53+}
54+void __set_dax_synchronous(struct dax_device *dax_dev);
55+static inline void set_dax_synchronous(struct dax_device *dax_dev)
56+{
57+ __set_dax_synchronous(dax_dev);
58+}
4659 #else
4760 static inline struct dax_device *dax_get_by_host(const char *host)
4861 {
4962 return NULL;
5063 }
5164 static inline struct dax_device *alloc_dax(void *private, const char *host,
52− const struct dax_operations *ops)
65+ const struct dax_operations *ops, unsigned long flags)
5366 {
5467 /*
5568 * Callers should check IS_ENABLED(CONFIG_DAX) to know if this
@@ -70,6 +83,13 @@ static inline bool dax_write_cache_enabled(struct dax_device *dax_dev) · 14 unmodified lines
7083 {
7184 return false;
7285 }
86+static inline bool dax_synchronous(struct dax_device *dax_dev)
87+{
88+ return true;
89+}
90+static inline void set_dax_synchronous(struct dax_device *dax_dev)
91+{
92+}
7393 #endif
7494
7595 struct writeback_control;
include/linux/libnvdimm.h+1−0
@@ -263,6 +263,7 @@ int generic_nvdimm_flush(struct nd_region *nd_region); · 262 unmodified lines
263263 int nvdimm_has_flush(struct nd_region *nd_region);
264264 int nvdimm_has_cache(struct nd_region *nd_region);
265265 int nvdimm_in_overwrite(struct nvdimm *nvdimm);
266+bool is_nvdimm_sync(struct nd_region *nd_region);
266267
267268 static inline int nvdimm_ctl(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
268269 unsigned int buf_len, int *cmd_rc)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t