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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gpfs_ireadx() Subroutine<br />

Name<br />

gpfs_ireadx() - Performs block level incremental read of a file within an incremental inode scan.<br />

Library<br />

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

Synopsis<br />

#include <br />

gpfs_off64_t gpfs_ireadx(gpfs_ifile_t *ifile,<br />

gpfs_iscan_t *iscan,<br />

void *buffer,<br />

int bufferSize,<br />

gpfs_off64_t *offset,<br />

gpfs_off64_t termOffset,<br />

int *hole);<br />

Description<br />

The gpfs_ireadx() subroutine performs a block level incremental read on a file opened by gpfs_iopen()<br />

within a given incremental scan opened using gpfs_open_inodescan().<br />

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

applications” on page 24.<br />

The gpfs_ireadx() subroutines returns the data that has changed since the prev_fssnapId specified for<br />

the inode scan. The file is scanned starting at offset <strong>and</strong> terminating at termOffset, looking for changed<br />

data. Once changed data is located, the offset parameter is set to its location, the new data is returned in<br />

the buffer provided, <strong>and</strong> the amount of data returned is the subroutine’s value.<br />

If the change to the data is that it has been deleted (that is, the file has been truncated), no data is<br />

returned, but the hole parameter is returned with a value of 1, <strong>and</strong> the size of the hole is returned as the<br />

subroutine’s value. The returned size of the hole may exceed the bufferSize provided. If no changed data<br />

was found before reaching the termOffset or the end-of-file, then the gpfs_ireadx() subroutine return<br />

value is 0.<br />

Block level incremental backups are available only if the previous snapshot was not deleted. If it was<br />

deleted, gpfs_ireadx() may still be used, but it returns all of the file’s data, operating like the st<strong>and</strong>ard<br />

gpfs_iread() subroutine. However, the gpfs_ireadx() subroutine will still identify sparse files <strong>and</strong> explicitly<br />

return information on holes in the files, rather than returning the NULL data.<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 />

ifile Pointer to gpfs_ifile_t returned from gpfs_iopen().<br />

iscan Pointer to gpfs_iscan_t from gpfs_open_inodescan().<br />

buffer Pointer to buffer for returned data, or NULL to query the next increment to be read.<br />

bufferSize Size of buffer for returned data.<br />

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

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

Saved successfully!

Ooh no, something went wrong!