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_next_inode() Subroutine<br />

Name<br />

gpfs_next_inode() - Retrieves the next inode from the inode scan.<br />

Library<br />

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

Synopsis<br />

#include <br />

int gpfs_next_inode(gpfs_iscan_t *iscan,<br />

gpfs_ino_t termIno,<br />

const gpfs_iattr_t **iattr);<br />

Description<br />

The gpfs_next_inode() subroutine obtains the next inode from the specified inode scan <strong>and</strong> sets the iattr<br />

pointer to the inode’s attributes. The termIno parameter can be used to terminate the inode scan before<br />

the last inode in the file system or snapshot being scanned. A value of 0 may be provided to indicate the<br />

last inode in the file system or snapshot. If there are no more inodes to be returned before the termination<br />

inode, the gpfs_next_inode() subroutine returns a value of 0 <strong>and</strong> the inode’s attribute pointer is set to<br />

NULL.<br />

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

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_next_inode() with the fssnapId that was obtained from<br />

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 an incremental backup, only inodes of files that have changed since the specified previous snapshot<br />

will be returned. Any operation that changes the file’s mtime or ctime is considered a change <strong>and</strong> will<br />

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

to atime, are omitted from the scan.<br />

Incremental backups return deleted files, but full backups do not. A deleted file is indicated by the field<br />

ia_nlinks having a value of 0.<br />

Notes:<br />

1. Compile any program that uses this subroutine with the -lgpfs flag from the following library:<br />

v libgpfs.a for AIX<br />

v libgpfs.so for Linux<br />

Parameters<br />

iscan Pointer to the inode scan h<strong>and</strong>le.<br />

termIno The inode scan terminates before this inode number. The caller may specify maxIno from<br />

gpfs_open_inodescan() or zero to scan the entire inode file.<br />

328 <strong>GPFS</strong>: <strong>Administration</strong> <strong>and</strong> <strong>Programming</strong> <strong>Reference</strong>

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

Saved successfully!

Ooh no, something went wrong!