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
1414 struct iomap_iter;
1515 struct iomap;
1616
17+enum dax_access_mode {
18+ DAX_ACCESS,
19+ DAX_RECOVERY_WRITE,
20+};
21+
1722 struct dax_operations {
1823 /*
1924 * direct_access: translate a device-relative
@@ -21,7 +26,7 @@ struct dax_operations { · 1 unmodified line
2126 * number of pages available for DAX at that pfn.
2227 */
2328 long (*direct_access)(struct dax_device *, pgoff_t, long,
24− void **, pfn_t *);
29+ enum dax_access_mode, void **, pfn_t *);
2530 /*
2631 * Validate whether this device is usable as an fsdax backing
2732 * device.
@@ -178,7 +183,7 @@ static inline void dax_read_unlock(int id) · 150 unmodified lines
178183 bool dax_alive(struct dax_device *dax_dev);
179184 void *dax_get_private(struct dax_device *dax_dev);
180185 long 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);
182187 size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr,
183188 size_t bytes, struct iov_iter *i);
184189 size_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
2020 struct dm_report_zones_args;
2121 struct mapped_device;
2222 struct bio_vec;
23+enum dax_access_mode;
2324
2425 /*
2526 * 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
146147 * >= 0 : the number of bytes accessible at the address
147148 */
148149 typedef 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);
150152 typedef int (*dm_dax_zero_page_range_fn)(struct dm_target *ti, pgoff_t pgoff,
151153 size_t nr_pages);
152154

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