nfsd_file_acquire_dir(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nfsd_file_acquire_dir(9) ✨

okay bestie, welcome to the Kernel API Manual page for nfsd_file_acquire_dir(9) β€” yes, she's a function, yes she's iconic, and yes we're gonna get through this together 🫢


🌸 NAME 🌸

nfsd_file_acquire_dir β€” get a struct nfsd_file with an open directory πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

__be32 nfsd_file_acquire_dir (struct svc_rqst *rqstp , struct svc_fh
*fhp , struct nfsd_file **pnf );

πŸŽ€ ARGUMENTS πŸŽ€

  • rqstp β€” the RPC transaction being executed, aka the whole reason we're here rn ✨
  • fhp β€” the NFS filehandle of the file to be opened πŸ”₯
  • pnf β€” OUT: the new or found "struct nfsd_file" object, she's giving output param energy πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

So the nfsd_file_object that this API hands back is reference-counted but not garbage-collected β€” ngl that distinction is kinda the whole vibe check here. The object gets unhashed after the final nfsd_file_put.

Also important: this opens directories only, and only in O_RDONLY mode. no cap, that's the entire range of what she does πŸ™ˆ

Return values: nfs_ok β€” and in that case pnf points to an nfsd_file with its reference count boosted πŸ’…

On error, an nfsstat value in network byte order is returned. periodt.


🌈 SEE ALSO 🌈

Kernel file ./fs/nfsd/filecache.c and all her besties:


bestie bestie bestie, quick recap before you go: directories only, O_RDONLY only, reference-counted but not garbage-collected, unhashed after the final nfsd_file_put 🧚 and on error you get an nfsstat in network byte order. mwah πŸ’‹

that's the whole page, and honestly? she ate. source: ./fs/nfsd 🌸 dated October 2026 πŸŽ€ β€” nfsd_file_acquire_dir(9), signing off πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from