nfs3svc_encode_entry3(9)
π nfs3svc_encode_entry3(9) β like, the Kernel API Manual page, bestie
okay so this is nfs3svc_encode_entry3(9) from the Kernel API Manual, and it's genuinely one of those little functions that does exactly one job and does it iconically. it encodes one NFSv3 READDIR entry. that's it. that's the whole personality. β¨
πΈ NAME πΈ
nfs3svc_encode_entry3 β encode one NFSv3 READDIR entry
no crumbs left, no cap. one entry, encoded, done. π
π¦ SYNOPSIS π¦
int nfs3svc_encode_entry3 (void *data , const char *name , int namlen ,
loff_t offset , u64 ino , unsigned int d_type );
like yes she takes six arguments, she's high-maintenance, we love her for it π
β¨ ARGUMENTS β¨
dataβ the directory context. this is the vibe check holder, the whole directory situation lives in here π«Άnameβ name of the object to be encoded. literally the name bestie, that's what's getting packed up π¦namlenβ length of that name, in bytes. yes, in bytes, not in vibes πoffsetβ the offset of the previous entry. previous, not this one, read it again, i'll wait πinoβ the fileid of this entry. her ID, her social security number, her whole identity πͺͺd_typeβ unused. not used. sitting there. decorative. main character energy with zero lines π
π₯ DESCRIPTION π₯
okay so here's the tea, the return values are giving very much "pass or fail" and there is no in-between:
0β entry was successfully encoded. slay. we ate. π-EINVALβ an encoding problem occurred, and the secondary status code lives inresp->common.errso go look there, that's where the drama is π
on exit, the following fields are updated β like, actually updated, these are the ones that changed:
resp->xdrresp->common.errresp->cookie_offset
that's the whole list, no extras, don't come for me πΈ
π SEE ALSO π
kernel file ./fs/nfsd/nfs3xdr.c (the source file, the mothership π), plus these absolute icons:
svcxdr_decode_nfs_fh3(9)svcxdr_encode_nfsstat3(9)svcxdr_encode_post_op_attr(9)nfs3svc_encode_cookie3(9)nfs3svc_encode_entryplus3(9)
all of them are lowkey required reading if you're going down this rabbit hole, iykyk π
and that's the whole page bestie β brought to you by the ./fs/nfsd source, from October 2026, filed under the Kernel API Manual. go encode something iconic ππΈβ¨
π¦ 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