nfsd_readdir(9)
β¨ nfsd_readdir(9) β the Kernel API Manual tea β¨
Okay bestie, so you've stumbled into the kernel API manual β welcome, this one's called nfsd_readdir and it literally does what it says on the tin: reads entries from a directory. No cap. π
πΈ NAME πΈ
nfsd_readdir β read entries from a directory π
β¨ SYNOPSIS β¨
__be32 nfsd_readdir (struct svc_rqst *rqstp , struct svc_fh *fhp ,
loff_t *offsetp , struct readdir_cd *cdp , nfsd_filldir_t func );
π¦ ARGUMENTS π¦
rqstpβ the RPC transaction context. the vibe of the whole call, basically π«Άfhpβ the NFS file handle of the directory we're about to read πoffsetpβ OUT: the seek offset of the final entry that was read. it hands that number back to you β¨cdpβ OUT: an eof error value, dropped right in there πfuncβ the entry filler actor. the little main character that actually does the filling π«
π DESCRIPTION π
So this implementation ignores the NFSv3/4 verifier cookie. Not a typo, not a bug note β it just doesn't use it. periodt. π
NB (no cap, this one matters): normal system calls holdfile->f_pos_lockwhen calling->iterate_sharedand->llseek, butnfsd_readdirdoes not. And like... that's fine here, because thestruct fileacquired here is not visible to other threads, so its internal state does not need mutex protection. the way that works out π
Returns nfs_ok on success, otherwise an nfsstat code comes back at you. π₯
(also yes, the original says "it's internal state" and we are not fixing the apostrophe, we are simply living with it π)
π§ SEE ALSO π§
Kernel file ./fs/nfsd/vfs.c, plus the whole friend group:
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_unlink(9), nfsd_filp_close(9), nfsd_removexattr(9), nfsd_get_case_info(9) πΈ
Okay that's the whole page, you ate that π β this little baddie lives in ./fs/nfsd and the docs are stamped October 2026. go read a directory, bestie, you've earned it ππ¦β¨
π¦ 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