diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-05-29 12:58:19 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-06-15 14:34:59 -0700 |
commit | 3c1cebff23cdca01c421411e953a9e239f2b9ef9 (patch) | |
tree | 91fe4cc0e3526e0795c28894692ec08c3852fed0 /include | |
parent | fec53774fd043038e57ac737d90e8d58975d6e92 (diff) | |
download | linux-3c1cebff23cdca01c421411e953a9e239f2b9ef9.tar.gz linux-3c1cebff23cdca01c421411e953a9e239f2b9ef9.tar.bz2 linux-3c1cebff23cdca01c421411e953a9e239f2b9ef9.zip |
dax, pmem: introduce an optional 'flush' dax_operation
Filesystem-DAX flushes caches whenever it writes to the address returned
through dax_direct_access() and when writing back dirty radix entries.
That flushing is only required in the pmem case, so add a dax operation
to allow pmem to take this extra action, but skip it for other dax
capable devices that do not provide a flush routine.
An example for this differentiation might be a volatile ram disk where
there is no expectation of persistence. In fact the pmem driver itself might
front such an address range specified by the NFIT. So, this "no flush"
property might be something passed down by the bus / libnvdimm.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dax.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 28e398f8c59e..407dd3ff6e54 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -19,6 +19,8 @@ struct dax_operations { /* copy_from_iter: dax-driver override for default copy_from_iter */ size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, struct iov_iter *); + /* flush: optional driver-specific cache management after writes */ + void (*flush)(struct dax_device *, pgoff_t, void *, size_t); }; #if IS_ENABLED(CONFIG_DAX) |