exportfs_encode_fh(9)
π exportfs_encode_fh(9)
okay so bestie, welcome to the Kernel API Manual β this one's exportfs_encode_fh(9) and it's literally the moment a dentry gets its glow-up into a file handle. no cap, it's a tiny page but it's doing the most. β¨
πΈ NAME πΈ
exportfs_encode_fh β encode a file handle from dentry
likeβ¦ you hand it a dentry and it hands you back the encoded file handle. it's giving matchmaker energy fr fr. π
π SYNOPSIS π
int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, int *max_len, int flags);
π¦ ARGUMENTS π¦
dentryβ the object to encode. yeah, that's the whole vibe check right there, it's the thing going in. πfidβ where to store the file handle fragment. this is the lil container that catches the output, bestie. πmax_lenβ maximum length to store there. a pointer to anint, so mind your limits β no overflowing the function's patience. πflagsβ properties of the requested file handle. it's the customization slot, like choosing your handle's aesthetic. β¨
π DESCRIPTION π
Returns an enum fid_type, or a negative errno.
that's it, that's the whole description β short and iconic. so like, on the success side you get an enum fid_type back, and if things go sideways you get a negative errno instead. so always check your return value, bestie, don't just assume it ate. π₯
π SEE ALSO π
- Kernel file
./fs/exportfs/expfs.c get_name(9)β related function, go look it up, iykyk πexportfs_encode_ino64_fid(9)β sibling function, same family tree β¨exportfs_encode_inode_fh(9)β another sibling, iconic trio honestly π«Ά
lowkey reminder:max_lenis a pointer, and it's the maximum length to store infidβ the docs are literally telling you the limit, so respect it. β
and that's the page, bestie β written up in ./fs/exportfs, dated October 2026, from the Kernel API Manual. slay, periodt, go encode some file handles. πππ¦
π¦ 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