ext2_alloc_blocks(9)
π ext2_alloc_blocks(9) π
okay so welcome to the Kernel API Manual, bestie β this one is all about grabbing multiple blocks for a branch, and honestly it's giving βallocator main character energy.β π
πΈ NAME πΈ
ext2_alloc_blocks β allocate multiple blocks needed for a branch. That's the whole vibe. π
β¨ SYNOPSIS β¨
int ext2_alloc_blocks (struct inode *inode , ext2_fsblk_t goal , int
indirect_blks , int blks , ext2_fsblk_t new_blocks[4] , int *err );
π ARGUMENTS π
inodeβ owner. Like, whose blocks are these? πgoalβ preferred place for allocation. It's giving βput it near here if you canβ energy. β¨indirect_blksβ the number of blocks needed to allocate for indirect blocks.blksβ the number of blocks need to allocate for direct blocks.new_blocksβ on return it will store the new block numbers for the indirect blocks(if needed) and the first direct block. Literally the receipts. π§Ύerrβ error pointer. That's it, that's the whole job. π«Ά
π₯ RETURN π₯
Number of blocks allocated. That's the return value, bestie β a count, periodt. π―
π¦ SEE ALSO π¦
- Kernel file
./fs/ext2/inode.c ext2_block_to_path(9)ext2_get_branch(9)ext2_find_near(9)ext2_find_goal(9)ext2_blks_to_allocate(9)ext2_alloc_branch(9)ext2_splice_branch(9)ext2_find_shared(9)ext2_free_data(9)ext2_free_branches(9)
xoxo, your fave kernel-docs bestie π
β source/version: ./fs/ext2, dated October 2026 π
π¦ 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