nilfs_sufile_updatev(9)
π 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 thesegnumvarray. how many are in the lineup, no cap.createβ the creation flag. yes it's called that. yes it matters. (see-ENOENTbelow π)ndoneβ the place to store the number of modified segments onsegnumv. 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 ifcreateis 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 π«Ά
- Kernel file
./fs/nilfs2/sufile.cβ literally where she lives π struct nilfs_sufile_info(9)nilfs_sufile_segment_usage_offset(9)nilfs_sufile_get_ncleansegs(9)nilfs_sufile_set_alloc_range(9)nilfs_sufile_alloc(9)nilfs_sufile_mark_dirty(9)nilfs_sufile_set_segment_usage(9)nilfs_sufile_get_stat(9)nilfs_sufile_truncate_range(9)nilfs_sufile_resize(9)nilfs_sufile_get_suinfo(9)nilfs_sufile_set_suinfo(9)nilfs_sufile_trim_fs(9)nilfs_sufile_read(9)
β¨ 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
- 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