nfsd_vfs_write(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, iykyk
  • nf β€” an open file that matches fhp. they're a matched set, don't split them up πŸ’–
  • offset β€” byte offset of the start. where the writing begins, no cap
  • payload β€” the xdr_buf holding the write payload, aka the actual goods πŸ¦‹
  • cnt β€” IN: number of bytes to write, OUT: number of bytes actually written. she does both jobs, iconic
  • stable β€” an NFS stable_how value. 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 invoke fh_put on fhp. 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 πŸ‘‘

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