nilfs_cpfile...kpoint_block(9)
β¨ nilfs_cpfile_find_checkpoint_block(9) β¨
okay so bestie, welcome to the Kernel API Manual, section 9 β today's main character is nilfs_cpfile_find_checkpoint_block, and no cap, this one is literally just "go find that checkpoint block and grab it" energy π
π NAME π
nilfs_cpfile_find_checkpoint_block β find and get a buffer on cpfile π¦
like, it finds the block, it gets the buffer, it's giving errand-runner for the checkpoint file, periodt.
β¨ SYNOPSIS β¨
int nilfs_cpfile_find_checkpoint_block (struct inode *cpfile , __u64
start_cno , __u64 end_cno , __u64 *cnop , struct buffer_head **bhp );
that's the whole vibe, copy it exactly, don't be weird about it π
πΈ ARGUMENTS πΈ
cpfileβ the inode of cpfile π like, the actual checkpoint file we're digging around instart_cnoβ start checkpoint number, inclusive (yes bestie, it counts) β¨end_cnoβ end checkpoint number, inclusive too, both ends are invited to the party πcnopβ the place to store the next checkpoint number π write it down, don't lose itbhpβ the place to store a pointer to thebuffer_headstruct π«Ά that's the buffer pointer handoff spot
π₯ RETURN π₯
0 on success π β and on failure, one of these negative error codes, and yes they're all a little bit of a moment π:
-EIOβ I/O error (including metadata corruption π). yeah, that one's rough, the metadata is corrupted, we're not okay-ENOENTβ no block exists in the range π literally nothing there, empty, ghost town-ENOMEMβ Insufficient memory available π΅βπ« out of memory, the classic
ngl, -EIO is the dramatic one β metadata corruption is not a vibe check you want to fail β οΈ
π SEE ALSO π
Kernel file ./fs/nilfs2/cpfile.c β and the whole cpfile friend group, all iconic, all linked:
nilfs_cpfile_checkpoint_offset(9)nilfs_cpfile_cp_snapshot_list_offset(9)nilfs_cpfile_ch_snapshot_list_offset(9)nilfs_cpfile_read_checkpoint(9)nilfs_cpfile_create_checkpoint(9)nilfs_cpfile_finalize_checkpoint(9)nilfs_cpfile_delete_checkpoints(9)nilfs_cpfile_get_cpinfo(9)nilfs_cpfile_delete_checkpoint(9)nilfs_cpfile_is_snapshot(9)nilfs_cpfile_change_cpmode(9)nilfs_cpfile_get_stat(9)nilfs_cpfile_read(9)
aaand that's the page bestie π
π this lil gem lives at ./fs/nilfs2, dated October 2026, and it's serving kernel API manual realness from start to finish. slay, go read your checkpoints π§ββοΈβπ
π¦ 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