History

fsdax: decouple zeroing from the iomap buffered I/O code

Unshare the DAX and iomap buffered I/O page zeroing code. This code previously did a IS_DAX check deep inside the iomap code, which in fact was the only DAX check in the code. Instead move these checks into the callers. Most callers already have DAX special casing anyway and XFS will need it for reflink support as well.

Christoph Hellwig committed 4 years ago

Commit c6f40461 parent e5c71956 files · +94 −44Browse files

Showing the changes to include (1 of 6 files). Show all

Unified · Split

include/linux/dax.h+6−1
@@ -14,6 +14,7 @@ typedef unsigned long dax_entry_t; · 13 unmodified lines
14struct dax_device;14struct dax_device;
15struct gendisk;15struct gendisk;
16struct iomap_ops;16struct iomap_ops;
17struct iomap_iter;
17struct iomap;18struct iomap;
18 19
19struct dax_operations {20struct dax_operations {
@@ -170,6 +171,11 @@ static inline void dax_unlock_page(struct page *page, dax_entry_t cookie) · 150 unmodified lines
170}171}
171#endif172#endif
172 173
174int dax_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero,
175 const struct iomap_ops *ops);
176int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
177 const struct iomap_ops *ops);
178
173#if IS_ENABLED(CONFIG_DAX)179#if IS_ENABLED(CONFIG_DAX)
174int dax_read_lock(void);180int dax_read_lock(void);
175void dax_read_unlock(int id);181void dax_read_unlock(int id);
@@ -204,7 +210,6 @@ vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, · 28 unmodified lines
204int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);210int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
205int dax_invalidate_mapping_entry_sync(struct address_space *mapping,211int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
206 pgoff_t index);212 pgoff_t index);
207s64 dax_iomap_zero(loff_t pos, u64 length, struct iomap *iomap);
208static inline bool dax_mapping(struct address_space *mapping)213static inline bool dax_mapping(struct address_space *mapping)
209{214{
210 return mapping->host && IS_DAX(mapping->host);215 return mapping->host && IS_DAX(mapping->host);

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