Add a helper dax_ioamp_zero() to zero a range. This patch basically merges __dax_zero_page_range() and iomap_dax_zero().
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -13,6 +13,7 @@ · 12 unmodified lines | |||
| 13 | typedef unsigned long dax_entry_t; | 13 | typedef unsigned long dax_entry_t; |
| 14 | 14 | ||
| 15 | struct iomap_ops; | 15 | struct iomap_ops; |
| 16 | struct iomap; | ||
| 16 | struct dax_device; | 17 | struct dax_device; |
| 17 | struct dax_operations { | 18 | struct dax_operations { |
| 18 | /* | 19 | /* |
| @@ -214,20 +215,8 @@ vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf, · 195 unmodified lines | |||
| 214 | int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); | 215 | int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); |
| 215 | int dax_invalidate_mapping_entry_sync(struct address_space *mapping, | 216 | int dax_invalidate_mapping_entry_sync(struct address_space *mapping, |
| 216 | pgoff_t index); | 217 | pgoff_t index); |
| 217 | 218 | int dax_iomap_zero(loff_t pos, unsigned offset, unsigned size, | |
| 218 | #ifdef CONFIG_FS_DAX | 219 | struct iomap *iomap); |
| 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 | |||
| 231 | static inline bool dax_mapping(struct address_space *mapping) | 220 | static 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); |