nfsd_unlink(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so you're looking at nfsd_unlink(9), straight out of the Kernel API Manual, and honestly? it's giving "small function, big responsibilities." Let's get into it πŸŽ€


✨ NAME ✨

nfsd_unlink β€” remove a directory entry. that's it, that's the vibe. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

__be32 nfsd_unlink (struct svc_rqst *rqstp , struct svc_fh *fhp , int
type , char *fname , int flen );

literally just copy that exactly, bestie, don't get creative with it πŸ’€


🌸 ARGUMENTS 🌸

  • rqstp β€” the RPC transaction context. it's the main character holding all the context for this whole call 🫢
  • fhp β€” the file handle of the parent directory that's about to get modified. yes, the parent one πŸ‘‘
  • type β€” the enforced file type of the object being removed. it's a whole vibe check on what you're allowed to delete πŸ”₯
  • fname β€” the name of the directory entry to be removed. the actual thing getting un-alived from the listing πŸ™ˆ
  • flen β€” length of fname in octets. octets!! not vibes, octets πŸ’œ

🌈 DESCRIPTION 🌈

okay so the one thing you CANNOT forget: after this call fhp needs an fh_put. like, that's not optional, that's not a suggestion, that's the rule. don't leave your file handle hanging, bestie 😭

and what does it give you back? a generic NFS status code in network byte-order. so like, byte-order matters here, fr fr ⭐


🧚 SEE ALSO 🧚

Kernel file ./fs/nfsd/vfs.c β€” go read the source, iykyk πŸ’…

like, that's the whole friend group right there. all of them. every single one. don't skip a single bestie in that list πŸ“


reminder: fhp needs its fh_put. i'm not gonna say it a third time... okay maybe i will. fh_put. periodt. πŸ’€

and that's the page!! brought to you by the fine folks over at ./fs/nfsd, dated October 2026 β€” mwah, sending you all the file-handle love, stay hydrated, and don't forget your fh_put πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from