xref: /linux-6.15/include/linux/fiemap.h (revision 135ec43e)
110c5db28SChristoph Hellwig /* SPDX-License-Identifier: GPL-2.0 */
210c5db28SChristoph Hellwig #ifndef _LINUX_FIEMAP_H
310c5db28SChristoph Hellwig #define _LINUX_FIEMAP_H 1
410c5db28SChristoph Hellwig 
510c5db28SChristoph Hellwig #include <uapi/linux/fiemap.h>
610c5db28SChristoph Hellwig #include <linux/fs.h>
710c5db28SChristoph Hellwig 
8*135ec43eSRandy Dunlap /**
9*135ec43eSRandy Dunlap  * struct fiemap_extent_info - fiemap request to a filesystem
10*135ec43eSRandy Dunlap  * @fi_flags:		Flags as passed from user
11*135ec43eSRandy Dunlap  * @fi_extents_mapped:	Number of mapped extents
12*135ec43eSRandy Dunlap  * @fi_extents_max:	Size of fiemap_extent array
13*135ec43eSRandy Dunlap  * @fi_extents_start:	Start of fiemap_extent array
14*135ec43eSRandy Dunlap  */
1510c5db28SChristoph Hellwig struct fiemap_extent_info {
16*135ec43eSRandy Dunlap 	unsigned int fi_flags;
17*135ec43eSRandy Dunlap 	unsigned int fi_extents_mapped;
18*135ec43eSRandy Dunlap 	unsigned int fi_extents_max;
19*135ec43eSRandy Dunlap 	struct fiemap_extent __user *fi_extents_start;
2010c5db28SChristoph Hellwig };
2110c5db28SChristoph Hellwig 
22cddf8a2cSChristoph Hellwig int fiemap_prep(struct inode *inode, struct fiemap_extent_info *fieinfo,
23cddf8a2cSChristoph Hellwig 		u64 start, u64 *len, u32 supported_flags);
2410c5db28SChristoph Hellwig int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
2510c5db28SChristoph Hellwig 			    u64 phys, u64 len, u32 flags);
2610c5db28SChristoph Hellwig 
2710c5db28SChristoph Hellwig #endif /* _LINUX_FIEMAP_H 1 */
28