ext4_move_extents(9)
π ext4_move_extents β like, the whole manual, but make it make sense
okay so bestie, welcome to the Kernel API Manual page for ext4_move_extents β¨ this is the function that, and I cannot stress this enough, exchanges the specified range of a file π₯ like it's a whole swap situation and you're the main character orchestrating it. let's get into it π«Ά
πΈ SYNOPSIS πΈ
int ext4_move_extents (struct file *o_filp , struct file *d_filp , __u64
orig_blk , __u64 donor_blk , __u64 len , __u64 *moved_len );
like yes that's the whole signature, copy it exactly, do not come for me about the spacing, it's giving verbatim π
π ARGUMENTS π
o_filpβ thestruct fileof the original file, aka the one we're messing with πd_filpβ thestruct fileof the donor file, aka where the good stuff comes from π¦orig_blkβ start offset, in blocks, fororigβdonor_blkβ start offset, in blocks, fordonorπlenβ the number of blocks to be moved, yes the actual amount, don't skimp πmoved_lenβ moved block length π
β¨ DESCRIPTION β¨
so here's the vibe check: this function returns 0 and sets the moved block length into moved_len if it succeeds π otherwise? it returns an error value π that's it, that's the whole deal, no cap.
lowkey important: it's 0 on success, error value on failure. don't be out here checking for the wrong thing bestie π
π₯ SEE ALSO π₯
- Kernel file
./fs/ext4/move_extent.c ext4_double_down_write_data_sem(9)ext4_double_up_write_data_sem(9)
like literally go read those too, they're iconic and you'll need them for the full picture π§
and that's the page!! π this one's from ./fs/ext4, dated October 2026, and it goes by ext4_move_extents(9) β mwah, slay, periodt π
π
π¦ 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