gfs2_getattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« gfs2_getattr(9) πŸ’«

okay so bestie, welcome to this lil page from the Kernel API Manual β€” it's the gfs2_getattr(9) moment, and I'm gonna walk you through it like we're texting. 🫢

🌸 NAME 🌸

gfs2_getattr β€” read out an inode's attributes ✨

πŸŽ€ SYNOPSIS πŸŽ€

here's the signature, copy-paste energy only:

int gfs2_getattr (struct mnt_idmap *idmap , const struct path *path ,
       struct kstat *stat , u32 request_mask , unsigned int flags );

πŸ’… ARGUMENTS πŸ’…

okay so the arguments are giving:

  • idmap β€” idmap of the mount the inode was found from
  • path β€” object to query
  • stat β€” the inode's stats
  • request_mask β€” mask of STATX_xxx flags indicating the caller's interests
  • flags β€” AT_STATX_xxx setting

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this may be called from the VFS directly, or from within GFS2 with the inode locked. so we look to see if the glock is already locked, and we only lock the glock if that hasn't already been done. also note: it's the NFS readdirplus operation that causes this to be called (from filldir) with the glock already held β€” iykyk πŸ’…

✨ RETURN ✨

the return is errno, periodt πŸ’–

πŸ’– SEE ALSO πŸ’–

the Kernel file is ./fs/gfs2/inode.c, and the whole SEE ALSO friend group is:

xoxo πŸ’– signing off from ./fs/gfs2 on October 2026 β€” this was gfs2_getattr(9), mwah! 🌈

πŸ“¦ where this page comes from