STRUCT FIEMAP(9)
πΈ NAME πΈ
struct fiemap β file extent mappings, aka the literal blueprint for asking the kernel "bestie, where does this file actually live on disk?" π
So this manual page is from the Kernel API Manual, and it's all about one iconic little struct. Periodt.
β¨ SYNOPSIS β¨
struct fiemap {
__u64 fm_start;
__u64 fm_length;
__u32 fm_flags;
__u32 fm_mapped_extents;
__u32 fm_extent_count;
struct fiemap_extent fm_extents[];
};
No cap, that's the whole shape of it. The fm_extents[] at the end is a flexible array β it's giving "the party's just getting started" energy π
π MEMBERS π
Ok so here's the breakdown of every single field, and whether you're the one filling it in or the kernel's handing it back to you. Pay attention to the (in) and (out) bestie, that's the whole vibe check π
fm_startβ byte offset (inclusive, so like, include it) where the mapping kicks off. You set this one, it's (in) πfm_lengthβ the logical length of the mapping that userspace is asking for. Also yours to fill in, (in) β¨fm_flagsβ theFIEMAP_FLAG_*flags for this request. This one's a two-way street β (in/out) π¦fm_mapped_extentsβ how many extents actually got mapped. The kernel tells you this one, so it's (out) πΈfm_extent_countβ the size of thefm_extentsarray. You declare it, (in) π«Άfm_extentsβ the array of mapped extents. The kernel fills this bad boy in for you, (out) π
Lowkey important: the(in)/(out)labels are the main character here. Getting them backwards means you're writing into a field the kernel owns, and that's not the slay you think it is π
π SEE ALSO π
- Kernel file
./include/uapi/linux/fiemap.h struct fiemap_extent(9)β the sequel, and honestly you will need to read it, iykyk π
Alright babes, that's the whole page π This was struct fiemap(9) from the Kernel API Manual, living its best life over at ./include/uapi/linux, dated October 2026. Go forth and map those extents, you absolute icon βπ
π¦ 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