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
1313 typedef unsigned long dax_entry_t;
1414
1515 struct iomap_ops;
16+struct iomap;
1617 struct dax_device;
1718 struct dax_operations {
1819 /*
@@ -214,20 +215,8 @@ vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, · 195 unmodified lines
214215 int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index);
215216 int dax_invalidate_mapping_entry_sync(struct address_space *mapping,
216217 pgoff_t index);
217−
218−#ifdef CONFIG_FS_DAX
219−int __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
223−static 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−
218+int dax_iomap_zero(loff_t pos, unsigned offset, unsigned size,
219+ struct iomap *iomap);
231220 static inline bool dax_mapping(struct address_space *mapping)
232221 {
233222 return mapping->host && IS_DAX(mapping->host);