gpfs_next_inode_with_xattrs() subroutine

Retrieves the next inode and its extended attributes from the inode scan.

Library

GPFS Library (libgpfs.a for AIX®, libgpfs.so for Linux®)

Synopsis

#include <gpfs.h>
int gpfs_next_inode_with_xattrs(gpfs_iscan_t *iscan,
                                gpfs_ino_t termIno,
                                const gpfs_iattr_t **iattr,
                                const char **xattrBuf,
                                unsigned int *xattrBufLen);

Description

The gpfs_next_inode_with_xattrs() subroutine retrieves the next inode and its extended attributes from the inode scan. The set of extended attributes returned are defined when the inode scan was opened. The scan stops before the last inode that was specified or the last inode in the inode file being scanned.

The data returned by gpfs_next_inode() is overwritten by subsequent calls to gpfs_next_inode(), gpfs_seek_inode(), or gpfs_stat_inode().

The termIno parameter provides a way to partition an inode scan so it can be run on more than one node.

The returned values for xattrBuf and xattrBufLen must be provided to gpfs_next_xattr() to obtain the extended attribute names and values. The buffer used for the extended attributes is overwritten by subsequent calls to gpfs_next_inode(), gpfs_seek_inode(), or gpfs_stat_inode().

The returned pointers to the extended attribute name and value will be aligned to a double-word boundary.

Parameters

iscan
A pointer to the inode scan descriptor.
termIno
The inode scan stops before this inode number. The caller can specify maxIno from gpfs_open_inodescan() or zero to scan the entire inode file.
iattr
A pointer to the returned pointer to the file's iattr.
xattrBuf
A pointer to the returned pointer to the xiattr buffer.
xattrBufLen
The returned length of the xiattr buffer.

Exit status

If the gpfs_next_inode_with_xattrs() subroutine is successful, it returns a value of 0 and iattr is set to point to gpfs_iattr_t. The pointer points to NULL if there are no more inodes, otherwise, the pointer points to gpfs_iattr_t.

If the gpfs_next_inode_with_xattrs() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to NULL to indicate the nature of the error.

Exceptions

None.

Error status

Error codes include but are not limited to the following:

EFAULT
The buffer data was overwritten.
ENOMEM
The buffer is too small, unable to allocate memory for the request.
ENOSYS
The gpfs_next_inode_with_xattrs() subroutine is not available.
EPERM
The caller does not have superuser privileges.
ESTALE
The cached file system information was not valid.
GPFS_E_INVAL_ISCAN
Incorrect parameters.
GPFS_E_INVAL_XATTR
Incorrect parameters.

Examples

For an example using gpfs_next_inode_with_xattrs(), see /usr/lpp/mmfs/samples/util/tsinode.c.

Location

/usr/lpp/mmfs/lib/libgpfs.a for AIX

/usr/lpp/mmfs/lib/libgpfs.so for Linux