nfsd_iter_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 nfsd_iter_read β€” the kernel-api manual, bestie edition 🌸

okay so real talk, this one's from the Kernel API Manual (section 9, nfsd_iter_read(9)), and it's genuinely the "hold my iced coffee" fallback of the NFSd read world. let's get into it πŸ’…


✨ NAME ✨

nfsd_iter_read β€” do a VFS read, but with an iterator. that's it, that's the vibe πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

__be32 nfsd_iter_read (struct svc_rqst *rqstp , struct svc_fh *fhp ,
struct nfsd_file *nf , loff_t offset , unsigned long *count , unsigned
int base , u32 *eof );

no cap, that's the whole signature. seven little parameters, all of them main characters πŸ’–


πŸ‘‘ ARGUMENTS πŸ‘‘

  • rqstp β€” the RPC transaction context. like, the whole situation this call is living inside of ✨
  • fhp β€” file handle of the file we're reading. the little ID card for the file πŸͺͺ
  • nf β€” the already-opened struct nfsd_file of the file to be read. somebody already did the opening, we're just here for the reading 🫢
  • offset β€” the starting byte offset. where in the file we're kicking things off ⭐
  • count β€” IN: the number of bytes you're asking for. OUT: the number of bytes you actually got. it's giving "this meeting could've been an email" but honestly it's just how the parameter works πŸ’€
  • base β€” the offset in the first page of the read buffer. yep, it's an offset inside a buffer, we love a nested coordinate moment 🌈
  • eof β€” OUT: gets set to non-zero if the operation reached the end of the file. the "we've hit the wall, bestie" flag 🧱

πŸ¦‹ DESCRIPTION πŸ¦‹

so some filesystems or some situations literally cannot use nfsd_splice_read. it's not their fault, it's just a whole thing. for those cases, this function is the fallback β€” and yes, it's the slightly less-performant one. lowkey the backup dancer of the read functions, but she still ate πŸ’…

on success it returns nfs_ok. if things go sideways, you get an nfserr stat value back instead. no drama, just error codes 😭


πŸ”₯ 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_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_readdir(9), nfsd_filp_close(9), nfsd_removexattr(9), nfsd_get_case_info(9)

like, the entire nfsd cinematic universe is in there. iykyk 🌟


heads up bestie: this is the fallback path, not the fast one. if you're in a position to use nfsd_splice_read, that's the slay option. this one's for when that literally isn't possible πŸ™ˆ

and that's the page!! πŸ’œ it lives in ./fs/nfsd and it's dated October 2026 β€” go off, future manpage, we love a timestamped icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from