nilfs_cpfile_get_cpinfo(9)
π 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:
nilfs_cpfile_checkpoint_offset(9)nilfs_cpfile_cp_snapshot_list_offset(9)nilfs_cpfile_ch_snapshot_list_offset(9)nilfs_cpfile_find_checkpoint_block(9)nilfs_cpfile_read_checkpoint(9)nilfs_cpfile_create_checkpoint(9)nilfs_cpfile_finalize_checkpoint(9)nilfs_cpfile_delete_checkpoints(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)
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
- 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