nfs3svc_encode_entry3(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 in resp->common.err so 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->xdr
  • resp->common.err
  • resp->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:

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