nfsd_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– nfsd_read(9) πŸ’–

ok so bestie, welcome to nfsd_read β€” it's from the Kernel API Manual, and it does exactly one thing and does it slay: read data from a file. That's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

__be32 nfsd_read (struct svc_rqst *rqstp , struct svc_fh *fhp , loff_t
offset , unsigned long *count , u32 *eof );

like, yes, that's the whole signature. yes, the line break is real. no cap. πŸ’…


🌸 ARGUMENTS 🌸

okay let's go through the cast of characters one by one, they all matter:

  • rqstp β€” the RPC transaction context. think of it as the group chat this whole operation is happening in 🫢
  • fhp β€” the file handle of the file you're reading from. the main character, honestly πŸ‘‘
  • offset β€” starting byte offset. where in the file we're kicking things off. literally just the starting point bestie πŸ“
  • count β€” this one's doing double duty and honestly, iconic: IN: the requested number of bytes; OUT: the number of bytes actually read. she comes in with one job and leaves with a different one πŸ’…βœ¨
  • eof β€” OUT: set non-zero if the operation reached the end of the file. so you know when you've hit the wall 🧱

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so before you even think about calling this, the caller must verify that there's enough space in rqstp.rq_res to perform this operation. like, that's on you, not on me. do your vibe check first ⭐

⚠️ N.B. β€” After this call fhp needs an fh_put. do NOT forget this part, i'm so serious 😭 it's giving "you broke it, you fix it" energy.

Returns nfs_ok on success, otherwise an nfserr stat value gets returned. that's it, that's the contract 🀝


🌈 SEE ALSO 🌈

okay the friend group is LARGE and i love them all, here we go β€” from the kernel file ./fs/nfsd/vfs.c:


anyway that's the page πŸ’œ this whole thing lives in ./fs/nfsd, it's part of the Kernel API Manual, and it's dated October 2026 β€” so mark your calendars bestie, see u then πŸ—“οΈβœ¨ mwah πŸ’‹

πŸ“¦ where this page comes from