nfsd_open_local_fh(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nfsd_open_local_fh β€” a whole kernel API manual, but make it make sense

okay so bestie, we're in the nfsd_open_local_fh(9) part of the Kernel API Manual today and honestly? she ate. lowkey a niche little function but the vibes are immaculate. let's get into it 🫢


✨ NAME ✨

nfsd_open_local_fh β€” lookup a local filehandle @nfs_fh and map to nfsd_file

like yes, that's the whole name section, she's concise, she's iconic, periodt πŸ’…


🌸 SYNOPSIS 🌸

struct nfsd_file * nfsd_open_local_fh (struct net *net , struct
auth_domain *dom , struct rpc_clnt *rpc_clnt , const struct cred *cred ,
const struct nfs_fh *nfs_fh , struct nfsd_file __rcu **pnf , const
fmode_t fmode );

seven arguments, bestie, SEVEN. she's high maintenance but worth it ngl 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • net β€” okay so the manpage literally gives zero description here. not a crumb. she's mysterious and we respect it πŸ™ˆ
  • dom β€” also no description given. the page just names her and moves on, main character energy fr fr
  • rpc_clnt β€” the rpc_clnt that the client established ✨
  • cred β€” the cred that the client established πŸ¦‹
  • nfs_fh β€” the filehandle to lookup
  • pnf β€” the place to find the nfsd_file, or store it if it was non-NULL
  • fmode β€” the fmode_t to use for open

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's what she actually does: this function maps a local fh to a path on a local filesystem. the way that's useful? when the nfs client has the local server mounted β€” then it can avoid all the NFS overhead with reads, writes and commits. no cap, she's literally skipping the whole traffic jam πŸ’€βœ¨

on successful return, the returned nfsd_file will have its nf_net member set. πŸ‘‘

and listen β€” the caller (that's the NFS client, iykyk) is responsible for calling nfsd_net_put and nfsd_file_put (via nfs_to_nfsd_file_put_local). so like, don't forget, bestie, that's on you 🫢

lowkey important: the caller owns the cleanup here. nfsd_net_put and nfsd_file_put (via nfs_to_nfsd_file_put_local) β€” do not ghost them πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./fs/nfsd/localio.c β€” go read her, she's the source of truth πŸ’–

and that's the page!! go forth and map those local filehandles, you absolute icon 🌈⭐

sign-off szn: this one's from ./fs/nfsd, dated October 2026, and it's nfsd_open_local_fh(9) β€” mwah, bye bestie πŸ’œπŸ“

πŸ“¦ where this page comes from