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
1313 fiemap_extent array */
1414 };
1515
16+int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
17+ u64 start, u64 *len, u32 supported_flags);
1618 int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
1719 u64 phys, u64 len, u32 flags);
18−int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1920
2021 int generic_block_fiemap(struct inode *inode,
2122 struct fiemap_extent_info *fieinfo, u64 start, u64 len,