nfssvc_encode_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– nfssvc_encode_entry πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one is a lil function called nfssvc_encode_entry, and it does exactly one (1) thing: it encodes one NFSv2 READDIR entry. that's it. that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

int nfssvc_encode_entry (void *data , const char *name , int namlen ,
       loff_t offset , u64 ino , unsigned int d_type );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • data β€” the directory context πŸ—‚οΈ like, the whole scene this entry lives in.
  • name β€” the name of the object you're encoding. the star of the show πŸ‘‘
  • namlen β€” how long that name is, counted in bytes (bytes!! not vibes).
  • offset β€” the offset of the previous entry. yes, previous. not this one. don't ask me why, that's just the lore 🫢
  • ino β€” the fileid of this entry. its little ID card πŸ’…
  • d_type β€” unused. literally unused. it's giving decorative. it's there, it's cute, it does nothing 🌸

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea β˜• β€” this function encodes one NFSv2 READDIR entry, and then it tells you how it went with these return values:

  • 0 β€” slay πŸ’… the entry was successfully encoded.
  • -EINVAL β€” uh oh 😭 an encoding problem occurred. the secondary status code lives in resp->common.err (iykyk).

and when it's done, on exit, these fields get updated:

  • resp->xdr
  • resp->common.err
  • resp->cookie_offset

that's the full list, no cap. three fields. updated. periodt πŸŽ€

ngl bestie, keep an eye on that -EINVAL path β€” if the encode goes sideways, resp->common.err is where the real story is πŸ”₯

🌈 SEE ALSO 🌈

go read those too, they're all in the same friend group fr fr 🫢✨


aaaand that's the page!! πŸ’– this whole thing lives in ./fs/nfsd and it's dated October 2026 β€” so go forth, encode that entry, and remember: one entry at a time, bestie 🧚 πŸ’œ

πŸ“¦ where this page comes from