History

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.

Jane Chu committed 4 years ago

Commit e511c4a1 parent 5898b4316 files · +61 −33Browse files

Showing the changes to include (2 of 16 files). Show all

Unified · Split

2 files
  1. include/linux/dax.h +7 −2
  2. include/linux/device-mapper.h +3 −1
include/linux/dax.h+7−2
@@ -14,6 +14,11 @@ struct iomap_ops; · 13 unmodified lines
14struct iomap_iter;14struct iomap_iter;
15struct iomap;15struct iomap;
16 16
17enum dax_access_mode {
18 DAX_ACCESS,
19 DAX_RECOVERY_WRITE,
20};
21
17struct dax_operations {22struct dax_operations {
18 /*23 /*
19 * direct_access: translate a device-relative24 * direct_access: translate a device-relative
@@ -21,7 +26,7 @@ struct dax_operations { · 1 unmodified line
21 * number of pages available for DAX at that pfn.26 * number of pages available for DAX at that pfn.
22 */27 */
23 long (*direct_access)(struct dax_device *, pgoff_t, long,28 long (*direct_access)(struct dax_device *, pgoff_t, long,
24 void **, pfn_t *);29 enum dax_access_mode, void **, pfn_t *);
25 /*30 /*
26 * Validate whether this device is usable as an fsdax backing31 * Validate whether this device is usable as an fsdax backing
27 * device.32 * device.
@@ -178,7 +183,7 @@ static inline void dax_read_unlock(int id) · 150 unmodified lines
178bool dax_alive(struct dax_device *dax_dev);183bool dax_alive(struct dax_device *dax_dev);
179void *dax_get_private(struct dax_device *dax_dev);184void *dax_get_private(struct dax_device *dax_dev);
180long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,185long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages,
181 void **kaddr, pfn_t *pfn);186 enum dax_access_mode mode, void **kaddr, pfn_t *pfn);
182size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,187size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
183 size_t bytes, struct iov_iter *i);188 size_t bytes, struct iov_iter *i);
184size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,189size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
include/linux/device-mapper.h+3−1
@@ -20,6 +20,7 @@ struct dm_table; · 19 unmodified lines
20struct dm_report_zones_args;20struct dm_report_zones_args;
21struct mapped_device;21struct mapped_device;
22struct bio_vec;22struct bio_vec;
23enum dax_access_mode;
23 24
24/*25/*
25 * Type of table, mapped_device's mempool and request_queue26 * Type of table, mapped_device's mempool and request_queue
@@ -146,7 +147,8 @@ typedef int (*dm_busy_fn) (struct dm_target *ti); · 120 unmodified lines
146 * >= 0 : the number of bytes accessible at the address147 * >= 0 : the number of bytes accessible at the address
147 */148 */
148typedef long (*dm_dax_direct_access_fn) (struct dm_target *ti, pgoff_t pgoff,149typedef long (*dm_dax_direct_access_fn) (struct dm_target *ti, pgoff_t pgoff,
149 long nr_pages, void **kaddr, pfn_t *pfn);150 long nr_pages, enum dax_access_mode node, void **kaddr,
151 pfn_t *pfn);
150typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,152typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,
151 size_t nr_pages);153 size_t nr_pages);
152 154

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