nfsd_vfs_write(9)
π nfsd_vfs_write(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel, the vibe is immaculate, and somebody needs to actually write bytes into a file that's already open. that's this function. welcome to nfsd_vfs_write, she's a whole moment β¨
β¨ SYNOPSIS β¨
__be32 nfsd_vfs_write (struct svc_rqst *rqstp , struct svc_fh *fhp ,
struct nfsd_file *nf , loff_t offset , const struct xdr_buf *payload ,
unsigned long *cnt , int stable , __be32 *verf );
like, look at her. eight arguments. main character energy fr fr π
πΈ ARGUMENTS πΈ
rqstpβ the RPC execution context, aka where this whole request is coming from πfhpβ file handle of the file we're writing into, iykyknfβ an open file that matchesfhp. they're a matched set, don't split them up πoffsetβ byte offset of the start. where the writing begins, no cappayloadβ thexdr_bufholding the write payload, aka the actual goods π¦cntβ IN: number of bytes to write, OUT: number of bytes actually written. she does both jobs, iconicstableβ an NFSstable_howvalue. yes that's the real name, I didn't make it up πverfβ the NFS WRITE verifier π
π DESCRIPTION π
heads up bestie: upon return, the caller must invokefh_putonfhp. this is not optional, this is not a suggestion, this is the rule. do not forget. I'm serious π«Ά
Return values: an nfsstat value in network byte order. so like, byte order matters, don't come at her with host order β
π§ SEE ALSO π§
Kernel file ./fs/nfsd/vfs.c β go read the source, she's right there π
nfserrno(9)nfsd_lookup(9)nfsd_setattr(9)nfsd4_is_junction(9)nfsd_open_verified(9)nfsd_splice_read(9)nfsd_iter_read(9)nfsd_read_splice_ok(9)nfsd_read(9)nfsd_write(9)nfsd_commit(9)nfsd_create_setattr(9)nfsd_symlink(9)nfsd_link(9)nfsd_rename(9)nfsd_unlink(9)nfsd_readdir(9)nfsd_filp_close(9)nfsd_removexattr(9)nfsd_get_case_info(9)
that's the whole friend group, they all hang out together π
and that's the page!! this one ships out of ./fs/nfsd and it's dated October 2026 β so like, mark your calendar bestie, that's the version you're reading, mwah π
β¨
π¦ 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