nfsd4_block...layoutupdate(9)
π 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β thesubbufset 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,iomappandnr_iomapspare valid. slay, we ate, everything came out gorgeous πnfserr_bad_xdrβ The encoded array inxdris invalid. the input was not it, chief πnfserr_invalβ An unaligned extent found. caught in 4k being unaligned πnfserr_delayβ Failed to allocate memory foriomapp. 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
- 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