nilfs_cpfile_get_cpinfo(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nilfs_cpfile_get_cpinfo(9) β€” or, how to peek at checkpoints, bestie

okay so this is a Kernel API Manual page for nilfs_cpfile_get_cpinfo, which lives in the kernel. yes, that kernel. we're in the big leagues now 🫢


✨ NAME ✨

nilfs_cpfile_get_cpinfo β€” literally just "get information on checkpoints" πŸ’– that's the whole vibe. she retrieves checkpoint deets, no cap.


🌸 SYNOPSIS 🌸

ssize_t nilfs_cpfile_get_cpinfo (struct inode *cpfile , __u64 *cnop ,
int mode , void *buf , unsigned int cisz , size_t nci );

look at her. six args. main character energy fr fr πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • cpfile β€” the checkpoint file inode πŸ’… like, the actual checkpoint file, as an inode. that's your source of truth.
  • cnop β€” the place where you pass in a starting checkpoint number, and the same spot receives a checkpoint number so you can keep searching πŸ” it's giving input-and-output, she does both.
  • mode β€” the mode of checkpoints that the caller wants to retrieve πŸ¦‹ you're being picky on purpose, and that's iconic.
  • buf β€” the buffer where the checkpoints' information gets stored 🎁
  • cisz β€” byte size of one checkpoint info item in the array πŸ“ yes, in the array. sizes matter.
  • nci β€” number of checkpoint info items to retrieve πŸ”’ how many you want, bestie.

🌈 DESCRIPTION 🌈

so nilfs_cpfile_get_cpinfo searches for checkpoints that are in the mode state, starting from the checkpoint number stored in cnop, and then it stores information about the checkpoints it found into buf ✨

the buffer pointed to by buf must be large enough to store information for nci checkpoints. like, non-negotiable. do the math before you call her πŸ™ˆ

and if at least one checkpoint information is successfully retrieved, cnop gets updated so it points to the checkpoint number to continue searching πŸ” so you can loop her and keep going. obsessed.


⭐ RETURN ⭐

on success you get the count of checkpoint info items stored in the output buffer πŸŽ‰ otherwise you get one of these negative error codes, and honestly, mood:

  • -EINVAL β€” Invalid checkpoint mode. 🚫
  • -ENOMEM β€” Insufficient memory available. 😭
  • -EIO β€” I/O error (including metadata corruption). πŸ’€ (yes, including metadata corruption. be scared.)
  • -ENOENT β€” Invalid checkpoint number specified. πŸ‘»

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/nilfs2/cpfile.c β€” and the whole friend group:


okay that's the whole page, go be a kernel dev about it πŸ§šπŸ’œ this one's from ./fs/nilfs2, dated October 2026 β€” so like, future iconic. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from