fh_getattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fh_getattr(9) β€” the kernel API manual, bestie edition ✨

Ok so real talk, this is a page from the Kernel API Manual, and it's about fh_getattr(9) β€” literally one of the most "small but crucial" functions in the nfsd friend group. It's giving supporting-character-who-ate-every-scene energy. πŸŽ€


🌸 NAME 🌸

fh_getattr β€” retrieve attributes on a local file. That's it, that's the whole vibe. It grabs the attrs, it hands them over, it slays. πŸ’…


✨ SYNOPSIS ✨

__be32 fh_getattr (const struct svc_fh *fhp , struct kstat *stat );

No cap, that's the whole signature. __be32 in, __be32 out, everybody claps. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • fhp β€” the file handle of the target file. Like, which file are we even talking about? This. This is the one. It's the main character of the operation. πŸ‘‘
  • stat β€” a caller-supplied kstat buffer that gets filled in. You bring the empty cup, the function pours the attributes in. Fill-in-the-blank but make it kernel. πŸ“

πŸ’– DESCRIPTION πŸ’–

So what does it actually do? It returns nfs_ok on success. That's the win. That's the slay. ✨

But if it doesn't go well? Then an NFS status code comes back instead. Not nfs_ok. A whole different code. Read it, don't ignore it, okay? 😭

πŸ”₯ SEE ALSO πŸ”₯

These are the besties it runs with, all living in the kernel file ./fs/nfsd/nfsfh.c:

Go read them too, they're all part of the same little ecosystem, iykyk. 🌈


And that's the page, bestie πŸ’œ β€” brought to you by ./fs/nfsd, dated October 2026, filed under fh_getattr(9). Periodt. πŸ’…πŸŒΈ

πŸ“¦ where this page comes from