dax: introduce DAX_RECOVERY_WRITE dax access mode
Up till now, dax_direct_access() is used implicitly for normal
access, but for the purpose of recovery write, dax range with
poison is requested. To make the interface clear, introduce
enum dax_access_mode {
DAX_ACCESS,
DAX_RECOVERY_WRITE,
}
where DAX_ACCESS is used for normal dax access, and
DAX_RECOVERY_WRITE is used for dax recovery write.
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
Link: https://lore.kernel.org/r/165247982851.52965.11024212198889762949.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
5898b43af9
commit
e511c4a3d2
16 changed files with 61 additions and 33 deletions
|
|
@ -14,6 +14,11 @@ struct iomap_ops;
|
|||
struct iomap_iter;
|
||||
struct iomap;
|
||||
|
||||
enum dax_access_mode {
|
||||
DAX_ACCESS,
|
||||
DAX_RECOVERY_WRITE,
|
||||
};
|
||||
|
||||
struct dax_operations {
|
||||
/*
|
||||
* direct_access: translate a device-relative
|
||||
|
|
@ -21,7 +26,7 @@ struct dax_operations {
|
|||
* number of pages available for DAX at that pfn.
|
||||
*/
|
||||
long (*direct_access)(struct dax_device *, pgoff_t, long,
|
||||
void **, pfn_t *);
|
||||
enum dax_access_mode, void **, pfn_t *);
|
||||
/*
|
||||
* Validate whether this device is usable as an fsdax backing
|
||||
* device.
|
||||
|
|
@ -178,7 +183,7 @@ static inline void dax_read_unlock(int id)
|
|||
bool dax_alive(struct dax_device *dax_dev);
|
||||
void *dax_get_private(struct dax_device *dax_dev);
|
||||
long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
|
||||
void **kaddr, pfn_t *pfn);
|
||||
enum dax_access_mode mode, void **kaddr, pfn_t *pfn);
|
||||
size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
|
||||
size_t bytes, struct iov_iter *i);
|
||||
size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ struct dm_table;
|
|||
struct dm_report_zones_args;
|
||||
struct mapped_device;
|
||||
struct bio_vec;
|
||||
enum dax_access_mode;
|
||||
|
||||
/*
|
||||
* Type of table, mapped_device's mempool and request_queue
|
||||
|
|
@ -146,7 +147,8 @@ typedef int (*dm_busy_fn) (struct dm_target *ti);
|
|||
* >= 0 : the number of bytes accessible at the address
|
||||
*/
|
||||
typedef long (*dm_dax_direct_access_fn) (struct dm_target *ti, pgoff_t pgoff,
|
||||
long nr_pages, void **kaddr, pfn_t *pfn);
|
||||
long nr_pages, enum dax_access_mode node, void **kaddr,
|
||||
pfn_t *pfn);
|
||||
typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,
|
||||
size_t nr_pages);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue