gfs2_trans_da_blks(9)
π« gfs2_trans_da_blks β the Kernel API Manual page, bestie edition β¨
okay so you're here for gfs2_trans_da_blks(9) from the Kernel API Manual β that's the manpage name, hi, welcome, come sit with me π This is the one that does the math on how many blocks you gotta reserve. Let's get into it.
πΈ NAME πΈ
gfs2_trans_da_blks β calculate number of blocks to link inode. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
unsigned gfs2_trans_da_blks (const struct gfs2_inode *dip , const struct
gfs2_diradd *da , unsigned nr_inodes );
it returns an unsigned, it takes three args, and yes you gotta write struct every time, that's just how C is, no cap β¨
π ARGUMENTS π
dipβ the directory we are linking into π she's the destination, the main character of this operation, lowkey.daβ the dir add information π that's the struct carrying the add details, k? k.nr_inodesβ the number of inodes involved π― how many little guys are in the mix. iykyk.
π§ DESCRIPTION π§
okay so the way that this works: this calculates the number of blocks we need to reserve in a transaction so we can link nr_inodes into a directory π« it's giving "do the accounting before you commit," which is honestly iconic of her.
in most cases nr_inodes will be 2 β that's the directory plus the inode being linked in, the classic pair, the duo, the bestie system π«Ά β but in case of rename, 4 may be required π (yes, rename is highkey extra, it's got more moving parts, we still love her).
π RETURN π
Number of blocks π₯ that's the return value. you asked how many blocks, she tells you how many blocks. periodt.
π SEE ALSO π
Kernel file ./fs/gfs2/inode.c β and like, all of these, go read them, they're all linked in the source:
gfs2_set_iop(9)gfs2_inode_lookup(9)gfs2_lookup_by_inum(9)gfs2_lookup_meta(9)gfs2_lookupi(9)create_ok(9)gfs2_init_xattr(9)init_dinode(9)gfs2_create_inode(9)gfs2_create(9)__gfs2_lookup(9)gfs2_link(9)gfs2_unlink_inode(9)gfs2_unlink(9)gfs2_symlink(9)gfs2_mkdir(9)gfs2_mknod(9)gfs2_atomic_open(9)update_moved_ino(9)gfs2_rename(9)gfs2_exchange(9)gfs2_get_link(9)gfs2_permission(9)gfs2_setattr(9)gfs2_getattr(9)
ok that's the whole page bestie, no notes π go reserve your blocks responsibly.
and that's a wrap on gfs2_trans_da_blks(9) π brought to you from ./fs/gfs2, dated October 2026 β mwah, love u, bye πβ¨
π¦ 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