ext4_move_extents(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct file of the original file, aka the one we're messing with πŸ’œ
  • d_filp β€” the struct file of the donor file, aka where the good stuff comes from πŸ¦‹
  • orig_blk β€” start offset, in blocks, for orig ⭐
  • donor_blk β€” start offset, in blocks, for donor 🌈
  • 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 πŸ”₯

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