29.01.2013 Views

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

GPFS: Administration and Programming Reference - IRA Home

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

gpfs_open_inodescan() Subroutine<br />

Name<br />

gpfs_open_inodescan() – Opens an inode scan of a file system or snapshot.<br />

Library<br />

<strong>GPFS</strong> Library (libgpfs.a for AIX, libgpfs.so for Linux)<br />

Synopsis<br />

#include <br />

gpfs_iscan_t *gpfs_open_inodescan<br />

(gpfs_fssnap_h<strong>and</strong>le_t *fssnapH<strong>and</strong>le,<br />

const gpfs_fssnap_id_t *prev_fssnapId,<br />

gpfs_ino_t *maxIno);<br />

Description<br />

The gpfs_open_inodescan() subroutine opens a scan of the inodes in the file system or snapshot<br />

identified by the fssnapH<strong>and</strong>le parameter. The scan traverses all user files, directories <strong>and</strong> links in the file<br />

system or snapshot. The scan begins with the user file with the lowest inode number <strong>and</strong> returns the files<br />

in increasing order. The gpfs_seek_inode() subroutine may be used to set the scan position to an<br />

arbitrary inode. System files, such as the block allocation maps, are omitted from the scan. The file system<br />

must be mounted to open an inode scan.<br />

For an overview of using gpfs_open_inodescan() in a backup application, see “Using APIs to develop<br />

backup applications” on page 24.<br />

To generate a full backup, invoke gpfs_open_inodescan() with NULL for the prev_fssnapId parameter.<br />

Repeated invocations of gpfs_next_inode() then return inode information about all existing user files,<br />

directories <strong>and</strong> links, in inode number order.<br />

To generate an incremental backup, invoke gpfs_open_inodescan() with the fssnapId that was obtained<br />

from a fssnapH<strong>and</strong>le at the time the previous backup was created. The snapshot that was used for the<br />

previous backup does not need to exist at the time the incremental backup is generated. That is, the<br />

backup application needs to remember only the fssnapId of the previous backup; the snapshot itself can<br />

be deleted as soon as the backup is completed.<br />

For the incremental backup, any operation that changes the file’s mtime or ctime causes the file to be<br />

included. Files with no changes to the file’s data or file attributes, other than a change to atime, are<br />

omitted from the scan.<br />

A full inode scan (prev_fssnapId set to NULL) does not return any inodes of nonexistent or deleted files,<br />

but an incremental inode scan (prev_fssnapId not NULL) does return inodes for files that have been<br />

deleted since the previous snapshot. The inodes of deleted files have a link count of zero.<br />

If the snapshot indicated by prev_fssnapId is available, the caller may benefit from the extended read<br />

subroutine, gpfs_ireadx(), which returns only the changed blocks within the files. Without the previous<br />

snapshot, all blocks within the changed files are returned.<br />

Once a full or incremental backup completes, the new_fssnapId must be saved in order to reuse it on a<br />

subsequent incremental backup. This fssnapId must be provided to the gpfs_open_inodescan()<br />

subroutine, as the prev_fssnapId input parameter.<br />

Chapter 9. <strong>GPFS</strong> programming interfaces 331

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!