nfsd_unlink(9)
π nfsd_unlink β the kernel API tea, bestie
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 offnamein 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 π
nfserrno(9)nfsd_lookup(9)nfsd_setattr(9)nfsd4_is_junction(9)nfsd_open_verified(9)nfsd_splice_read(9)nfsd_iter_read(9)nfsd_vfs_write(9)nfsd_read_splice_ok(9)nfsd_read(9)nfsd_write(9)nfsd_commit(9)nfsd_create_setattr(9)nfsd_symlink(9)nfsd_link(9)nfsd_rename(9)nfsd_readdir(9)nfsd_filp_close(9)nfsd_removexattr(9)nfsd_get_case_info(9)
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:fhpneeds itsfh_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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms