fiemap_fill_next_extent(9)
πΈ fiemap_fill_next_extent(9) πΈ
okay bestie, welcome to the Kernel API Manual girlypop edition π this one's a tiny little helper in section 9, and no cap it's lowkey iconic for anyone doing filesystem fiemap stuff π¦
β¨ NAME β¨
fiemap_fill_next_extent β the fiemap helper function, and yes she's literally doing exactly what her name says π
π«Ά SYNOPSIS π«Ά
int fiemap_fill_next_extent (struct fiemap_extent_info *fieinfo , u64
logical , u64 phys , u64 len , u32 flags );
like, look at her. five args, one int back, main character energy fr fr β
π ARGUMENTS π
fieinfoβ the fiemap context that got passed into->fiemap. she's the vibe carrier, everything flows through her πlogicalβ where this extent starts logically, in bytes π«physβ where this extent starts physically, in bytes (yes, also bytes, keep up bestie) π₯lenβ how long this extent is, in bytes. bytes bytes bytes, it's giving consistency πflagsβ theFIEMAP_EXTENTflags that describe this particular extent. she's the personality of the extent ngl π
π¦ DESCRIPTION π¦
so here's the tea β β you call this from a file system's ->fiemap callback. it'll populate the extent info with everything you passed in through the arguments, and then it copies that over to user memory. on success, the extent count on fieinfo gets incremented, like a little counter going up-up-up πβ¨
and the returns? gorgeous, three flavors:
0β success, we ate π-errnoon error β something went sideways, go check that errno bestie π1β this was the last extent that will fit in the user array. like the car is full, no more passengers, wrap it up ππ¨
no cap, that 1 is important β it's your signal that the user array is donezo, so don't go cramming more in there π
πΈ SEE ALSO πΈ
- Kernel file
./fs/ioctl.cβvfs_ioctl(9),fiemap_prep(9),compat_ptr_ioctl(9) - go read those too, they're all in the same friend group π«Άπ§
and that's the whole page, periodt π this lil cutie lives in ./fs, it's dated October 2026, stamped with the Kernel API Manual name and the title fiemap_fill_next_extent(9) β slay, go forth and fill those extents bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms