History

fs: move fiemap range validation into the file systems instances

Replace fiemap_check_flags with a fiemap_prep helper that also takes the inode and mapped range, and performs the sanity check and truncation previously done in fiemap_check_range. This way the validation is inside the file system itself and thus properly works for the stacked overlayfs case as well.

Christoph Hellwig committed 6 years ago

Commit cddf8a21 parent 273288110 files · +47 −54Browse files

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

Unified · Split

include/linux/fiemap.h+2−1
@@ -13,9 +13,10 @@ struct fiemap_extent_info { · 12 unmodified lines
13 fiemap_extent array */13 fiemap_extent array */
14};14};
15 15
16int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
17 u64 start, u64 *len, u32 supported_flags);
16int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,18int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
17 u64 phys, u64 len, u32 flags);19 u64 phys, u64 len, u32 flags);
18int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
19 20
20int generic_block_fiemap(struct inode *inode,21int generic_block_fiemap(struct inode *inode,
21 struct fiemap_extent_info *fieinfo, u64 start, u64 len,22 struct fiemap_extent_info *fieinfo, u64 start, u64 len,