nfsd_cache_update(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ nfsd_cache_update ✨

Okay bestie, so this is a kernel API manual page for nfsd_cache_update β€” and before you ask, yes, it's literally about the duplicate reply cache in the NFS server. We're talking about updating one tiny little entry in that cache, and it's giving very "behind the scenes main character energy" because you never see it, but it's doing SO much. πŸ’…


🌸 SYNOPSIS 🌸

void nfsd_cache_update (struct svc_rqst *rqstp , struct nfsd_cacherep
*rp , int cachetype , __be32 *statp );

πŸ’– ARGUMENTS πŸ’–

  • rqstp β€” an svc_rqst that's got a finished Reply, like it's all done and ready to slay ✨
  • rp β€” IN: the DRC entry for this request. Think of it as the little cache passport for this specific request πŸ›‚
  • cachetype β€” tells you which cache we're updating. Choose wisely, bestie πŸŽ€
  • statp β€” a pointer to the Reply's NFS status code, or NULL. Lowkey nullable, highkey important 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: this function gets called from nfsd_dispatch when the procedure has been executed and the complete reply is sitting pretty in rqstp->rq_res. Iconic. 🌟

We're copying around data here instead of swapping buffers β€” and the reason is actually so real. The toplevel loop requires max-sized buffers, and using those for a cache that has a max reply size of just 100 bytes (diropokres) would be a total waste of memory. Not the vibe. Not it. πŸ’€

And get this β€” if we ever start using different types of cache entries tailored specifically for attrstat and fh's, we might save even more space. Future us could really eat with that. πŸ”₯

Also note (important bestie!): a cachetype of RC_NOCACHE can legally be passed when nfsd failed to encode a reply that otherwise would have been cached. In this case, nfsd_cache_update is called with statp == NULL. No cap, that's just how it is. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./fs/nfsd/nfscache.c, plus these iconic functions that you should fr fr check out:


That's the whole page, bestie β€” every flag, every argument, every lil' detail preserved with love. πŸ’œ This gem lives in ./fs/nfsd and the source/version is from October 2026, so mark your calendar. Stay cunty, stay cached. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from