fiemap_fill_next_extent(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 β€” the FIEMAP_EXTENT flags 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 πŸ’…
  • -errno on 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 🌸


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