Chapter 6 Checkpoints/Snapshots 6-3
6.1.2 Checkpoint Lifecycle
Checkpoints are created and managed using the fs_chkpntcl( ) function of filesystem
which is sfs2_chkpntctl( ) for SFS2 filesystem. The checkpoint management
interfaces use this call to create, delete and deactivate checkpoints and checkpointing
on sfs2 filesystems.
Checkpoints have three states:
Active: while checkpoints are active, they can be accessed for most of the read-
only file system operations.
Delete pending: when a checkpoint has expired and automatically removed by
the system or users explicitly remove them, they are marked as "delete pending."
Later, one of the file system workers (or threads) called checkpoint cleaner will
actually remove it. When a checkpoint status is changed from active, it will no
longer be accessible and a new checkpoint with the same name can be created.
Deleting: while the checkpoint cleaner is removing a checkpoint, its state is
deleting.

6.1.2.1 Checkpoint Creation

There is a special mode page for checkpointing that is like a directory and contains
all of the information about checkpoints on an sfs2 filesystem. The address of this
page is in the volume label of the SFS2 filesystem. It is allocated when checkpoints
are active on an SFS2 filesystem.
This page contains a table of active checkpoints on filesystem, properties of
checkpoints (whether they are visible or not…) and also an array of pointers which
are the first of a three-level indirection to pages containing the mappings for the LFS
blocks. (The mappings are described in the next section.) There is also a stack of
active checkpoints. Each checkpoint that is created will be pushed on top of the
stack. When creating a checkpoint, the sfs2cp_dirop( ) function is called by the
sfs2_chkpntctl( ) function. This function creates a checkpoint in the checkpoint
pseudo-directory.