diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2018-05-02 09:46:33 -0400 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2018-05-23 02:18:31 -0400 |
| commit | b3a9a0c36e1f7b9e2e6cf965c2bb973624f2b3b9 (patch) | |
| tree | 54f43a8720a29159310b112cf21e7d3a3b5dce85 /include/linux/dax.h | |
| parent | 522239b445a2de988edb81672963708a6aaf9046 (diff) | |
dax: Introduce a ->copy_to_iter dax operation
Similar to the ->copy_from_iter() operation, a platform may want to
deploy an architecture or device specific routine for handling reads
from a dax_device like /dev/pmemX. On x86 this routine will point to a
machine check safe version of copy_to_iter(). For now, add the plumbing
to device-mapper and the dax core.
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/dax.h')
| -rw-r--r-- | include/linux/dax.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index f9eb22ad341e..a43b396fb336 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
| @@ -20,6 +20,9 @@ struct dax_operations { | |||
| 20 | /* copy_from_iter: required operation for fs-dax direct-i/o */ | 20 | /* copy_from_iter: required operation for fs-dax direct-i/o */ |
| 21 | size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, | 21 | size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, |
| 22 | struct iov_iter *); | 22 | struct iov_iter *); |
| 23 | /* copy_to_iter: required operation for fs-dax direct-i/o */ | ||
| 24 | size_t (*copy_to_iter)(struct dax_device *, pgoff_t, void *, size_t, | ||
| 25 | struct iov_iter *); | ||
| 23 | }; | 26 | }; |
| 24 | 27 | ||
| 25 | extern struct attribute_group dax_attribute_group; | 28 | extern struct attribute_group dax_attribute_group; |
| @@ -118,6 +121,8 @@ long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, | |||
| 118 | void **kaddr, pfn_t *pfn); | 121 | void **kaddr, pfn_t *pfn); |
| 119 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | 122 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, |
| 120 | size_t bytes, struct iov_iter *i); | 123 | size_t bytes, struct iov_iter *i); |
| 124 | size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | ||
| 125 | size_t bytes, struct iov_iter *i); | ||
| 121 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); | 126 | void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); |
| 122 | 127 | ||
| 123 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, | 128 | ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
