nfsd_file_acquire_gc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

nfsd_file_acquire_gc β€” bestie, this is how you get a struct nfsd_file that has an open file attached 🫢

✨ SYNOPSIS ✨

__be32 nfsd_file_acquire_gc (struct svc_rqst *rqstp , struct svc_fh *fhp
, unsigned int may_flags , struct nfsd_file **pnf );

πŸŽ€ ARGUMENTS πŸŽ€

  • rqstp β€” the RPC transaction that's currently being executed, aka the main character of this call πŸ’…
  • fhp β€” the NFS filehandle of the file you want opened πŸ”₯
  • may_flags β€” the NFSD_MAY_ settings for the file, so it knows what it's allowed to do ✨
  • pnf β€” OUT parameter: the new-or-found "struct nfsd_file" object lands here πŸ¦‹

🌸 DESCRIPTION 🌸

Okay so the nfsd_file object this API hands back is reference-counted and garbage-collected. It sticks around for a few seconds after the final nfsd_file_put, just in case the caller wants to re-use it. Lowkey thoughtful of it, honestly 😭

Return values, bestie: nfs_ok means pnf points to an nfsd_file with its reference count boosted. Periodt.

On error, an nfsstat value in network byte order is returned. Not me stressing over byte order πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/nfsd/filecache.c


That's the whole vibe check, bestie β€” sourced from ./fs/nfsd, dated October 2026. Go be iconic with your filehandles πŸ’œβœ¨

πŸ“¦ where this page comes from