nilfs_cpfile...kpoint_block(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 in
  • start_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 it
  • bhp β€” the place to store a pointer to the buffer_head struct 🫢 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:


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