nfssvc_encode_entry(9)
π 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 inresp->common.err(iykyk).
and when it's done, on exit, these fields get updated:
resp->xdrresp->common.errresp->cookie_offset
that's the full list, no cap. three fields. updated. periodt π
ngl bestie, keep an eye on that-EINVALpath β if the encode goes sideways,resp->common.erris where the real story is π₯
π SEE ALSO π
- Kernel file
./fs/nfsd/nfsxdr.c svcxdr_encode_stat(9)svcxdr_decode_fhandle(9)svcxdr_encode_fattr(9)nfssvc_encode_nfscookie(9)
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
- 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