History

dax,iomap: Add helper dax_iomap_zero() to zero a range

Add a helper dax_ioamp_zero() to zero a range. This patch basically merges __dax_zero_page_range() and iomap_dax_zero().

Vivek Goyal committed 6 years ago

Commit 4f3b4f11 parent 0a23f9f3 files · +12 −30Browse files

Showing the changes to include/linux (1 of 3 files). Show all

Unified · Split

include/linux/dax.h+3−14
@@ -13,6 +13,7 @@ · 12 unmodified lines
13typedef unsigned long dax_entry_t;13typedef unsigned long dax_entry_t;
14 14
15struct iomap_ops;15struct iomap_ops;
16struct iomap;
16struct dax_device;17struct dax_device;
17struct dax_operations {18struct dax_operations {
18 /*19 /*
@@ -214,20 +215,8 @@ vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, · 195 unmodified lines
214int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);215int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
215int dax_invalidate_mapping_entry_sync(struct address_space *mapping,216int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
216 pgoff_t index);217 pgoff_t index);
217 218int dax_iomap_zero(loff_t pos, unsigned offset, unsigned size,
218#ifdef CONFIG_FS_DAX219 struct iomap *iomap);
219int __dax_zero_page_range(struct block_device *bdev,
220 struct dax_device *dax_dev, sector_t sector,
221 unsigned int offset, unsigned int length);
222#else
223static inline int __dax_zero_page_range(struct block_device *bdev,
224 struct dax_device *dax_dev, sector_t sector,
225 unsigned int offset, unsigned int length)
226{
227 return -ENXIO;
228}
229#endif
230
231static inline bool dax_mapping(struct address_space *mapping)220static inline bool dax_mapping(struct address_space *mapping)
232{221{
233 return mapping->host && IS_DAX(mapping->host);222 return mapping->host && IS_DAX(mapping->host);