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
7#include <linux/radix-tree.h>7#include <linux/radix-tree.h>
8#include <asm/pgtable.h>8#include <asm/pgtable.h>
9 9
10/* Flag for synchronous flush */
11#define DAXDEV_F_SYNC (1UL << 0)
12
10typedef unsigned long dax_entry_t;13typedef unsigned long dax_entry_t;
11 14
12struct iomap_ops;15struct iomap_ops;
@@ -38,18 +41,28 @@ extern struct attribute_group dax_attribute_group; · 25 unmodified lines
38#if IS_ENABLED(CONFIG_DAX)41#if IS_ENABLED(CONFIG_DAX)
39struct dax_device *dax_get_by_host(const char *host);42struct dax_device *dax_get_by_host(const char *host);
40struct dax_device *alloc_dax(void *private, const char *host,43struct dax_device *alloc_dax(void *private, const char *host,
41 const struct dax_operations *ops);44 const struct dax_operations *ops, unsigned long flags);
42void put_dax(struct dax_device *dax_dev);45void put_dax(struct dax_device *dax_dev);
43void kill_dax(struct dax_device *dax_dev);46void kill_dax(struct dax_device *dax_dev);
44void dax_write_cache(struct dax_device *dax_dev, bool wc);47void dax_write_cache(struct dax_device *dax_dev, bool wc);
45bool dax_write_cache_enabled(struct dax_device *dax_dev);48bool dax_write_cache_enabled(struct dax_device *dax_dev);
49bool __dax_synchronous(struct dax_device *dax_dev);
50static inline bool dax_synchronous(struct dax_device *dax_dev)
51{
52 return __dax_synchronous(dax_dev);
53}
54void __set_dax_synchronous(struct dax_device *dax_dev);
55static inline void set_dax_synchronous(struct dax_device *dax_dev)
56{
57 __set_dax_synchronous(dax_dev);
58}
46#else59#else
47static inline struct dax_device *dax_get_by_host(const char *host)60static inline struct dax_device *dax_get_by_host(const char *host)
48{61{
49 return NULL;62 return NULL;
50}63}
51static inline struct dax_device *alloc_dax(void *private, const char *host,64static 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)
53{66{
54 /*67 /*
55 * Callers should check IS_ENABLED(CONFIG_DAX) to know if this68 * 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
70{83{
71 return false;84 return false;
72}85}
86static inline bool dax_synchronous(struct dax_device *dax_dev)
87{
88 return true;
89}
90static inline void set_dax_synchronous(struct dax_device *dax_dev)
91{
92}
73#endif93#endif
74 94
75struct writeback_control;95struct writeback_control;
include/linux/libnvdimm.h+1−0
@@ -263,6 +263,7 @@ int generic_nvdimm_flush(struct nd_region *nd_region); · 262 unmodified lines
263int nvdimm_has_flush(struct nd_region *nd_region);263int nvdimm_has_flush(struct nd_region *nd_region);
264int nvdimm_has_cache(struct nd_region *nd_region);264int nvdimm_has_cache(struct nd_region *nd_region);
265int nvdimm_in_overwrite(struct nvdimm *nvdimm);265int nvdimm_in_overwrite(struct nvdimm *nvdimm);
266bool is_nvdimm_sync(struct nd_region *nd_region);
266 267
267static inline int nvdimm_ctl(struct nvdimm *nvdimm, unsigned int cmd, void *buf,268static inline int nvdimm_ctl(struct nvdimm *nvdimm, unsigned int cmd, void *buf,
268 unsigned int buf_len, int *cmd_rc)269 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