nfsd4_block...layoutupdate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nfsd4_block...layoutupdate(9) πŸ’…

okay bestie, welcome to the Kernel API Manual β€” yes that's the manual name, it's giving ✨official✨ β€” and today we're decoding a little block-layout gossip. sit down, grab a boba, this one's actually so cute πŸŽ€


🌸 NAME 🌸

nfsd4_block_decode_layoutupdate β€” decode the block layout extent array. that's it. that's the whole vibe. it takes the encoded array and turns it into something you can actually use πŸ¦‹


✨ SYNOPSIS ✨

__be32 nfsd4_block_decode_layoutupdate (struct xdr_stream *xdr , struct
iomap **iomapp , int *nr_iomapsp , u32 block_size );

like, yeah, that's the whole signature. four params, one return, zero drama πŸ’…


🫢 ARGUMENTS 🫢

  • xdr β€” the subbuf set to the encoded array. this is the raw material, the clay we're molding, the pre-glow-up pic πŸ“Έ
  • iomapp β€” pointer to store the decoded extent array. she's an output param and she's thriving πŸ’–
  • nr_iomapsp β€” pointer to store the number of extents. gotta know how many we got, periodt πŸ”₯
  • block_size β€” alignment of extent offset and length. the ruler. the standards. the vibe check for alignment πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

okay so picture this: there's a layoutupdate4 structure chilling inside a layoutcommit request, right? and it's got this opaque field, and our girl's whole job is to decode that field for the block layout driver. and the field? not just some random bytes β€” it's literally an array of extents that the client sent over. no cap 🧚

she also checks that the file offset, storage offset and length of each extent are aligned by block_size. like, bestie, if it's not aligned we're gonna have a problem, and the problem is nfserr_inval 😭

⭐ Return values ⭐

  • nfs_ok β€” Successful decoding, iomapp and nr_iomapsp are valid. slay, we ate, everything came out gorgeous πŸ‘‘
  • nfserr_bad_xdr β€” The encoded array in xdr is invalid. the input was not it, chief πŸ’€
  • nfserr_inval β€” An unaligned extent found. caught in 4k being unaligned πŸ™ˆ
  • nfserr_delay β€” Failed to allocate memory for iomapp. the malloc said "no <3" and honestly we respect the boundary πŸ“

🌈 SEE ALSO 🌈

  • Kernel file ./fs/nfsd/blocklayoutxdr.c β€” like, go read the source bestie, it's right there iykyk πŸ“
  • nfsd4_block_encode_layoutget(9) β€” the encode side, the mirror twin, the other half of the story πŸͺž
  • nfsd4_scsi_decode_layoutupdate(9) β€” the SCSI cousin who does basically the same thing but with different lore πŸ¦‹

ngl, this page is small but she's got range. don't skip the alignment check, fr fr. it's not decorative πŸ’…

kisses, this was nfsd4_block...layoutupdate(9) from ./fs/nfsd, dated October 2026 β€” the Kernel API Manual said "that's a wrap" and honestly? iconic. byeee πŸŽ€βœ¨

πŸ“¦ where this page comes from