nilfs_sufile_updatev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nilfs_sufile_updatev β€” the kernel API manual, bestie edition πŸŽ€

okay so real talk, this little cutie lives in the Kernel API Manual section (9), and her whole personality is: modify multiple segment usages at a time. plural!! batch mode!! she does not do one-at-a-time, that's giving main character energy for a function that's literally a loop πŸ’€


✨ SYNOPSIS ✨

int nilfs_sufile_updatev (struct inode *sufile , __u64 *segnumv , size_t
nsegs , int create , size_t *ndone , void (*dofunc)(struct inode *,
__u64, struct buffer_head *, struct buffer_head *) );

look at her. six whole parameters. she's booked and busy 🫢


🌸 ARGUMENTS 🌸

  • sufile β€” the inode of the segment usage file. that's her home base, her apartment, her whole vibe πŸ’–
  • segnumv β€” an array of segment numbers. like a little lineup of segments waiting their turn ✨
  • nsegs β€” the size of the segnumv array. how many are in the lineup, no cap.
  • create β€” the creation flag. yes it's called that. yes it matters. (see -ENOENT below πŸ‘€)
  • ndone β€” the place to store the number of modified segments on segnumv. her little receipt 🧾
  • dofunc β€” the primitive operation for the update. the actual work-doer. the icon, the legend, the moment πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

so nilfs_sufile_updatev repeatedly calls dofunc against the given array of segments. like, in a loop. over and over. she's consistent, she's reliable, she ate πŸ’…

dofunc is called with buffers of a header block and the sufile block in which the target segment usage entry is contained. two buffers, one function pointer, tons of drama ✨

and if ndone is given, the number of successfully modified segments from the head is stored in the place ndone points to. key detail: from the head. so it's a count of how far she got before anything went sideways, iykyk πŸ›


😭 RETURN 😭

0 on success πŸŽ‰ β€” or one of these negative error codes on failure, and ngl some of them are lowkey scary:

  • -EINVAL β€” Invalid segment usage number. she looked at the number and said "ma'am, no." πŸ™ˆ
  • -EIO β€” I/O error (including metadata corruption). this one is the bad one, fr fr. metadata corruption is not a vibe πŸ’€
  • -ENOENT β€” Given segment usage is in hole block (may be returned if create is zero). so like, the thing isn't there, and you told her not to create it, so… shrug 🌸
  • -ENOMEM β€” Insufficient memory available. she's out of RAM, she's out of spoons, it's over 😭
⚠️ heads up bestie: -EIO explicitly covers metadata corruption, so please don't just retry it and hope for the best, okay? that's not slay behavior.

πŸ¦‹ SEE ALSO πŸ¦‹

all her friends!! the whole friend group!! go read up on them 🫢


✨ and that's the whole page, bestie ✨

this icon is filed under ./fs/nilfs2 in the Kernel API Manual, dated October 2026 β€” and the page itself is nilfs_sufile_updatev(9). mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from