gpfs_next_inode_with_xattrs64() 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_xattrs64(gpfs_iscan_t *iscan,
                                  gpfs_ino64_t termIno,
                                  const gpfs_iattr64_t **iattr,
                                  const char **xattrBuf,
                                  unsigned int *xattrBufLen);

Description

The gpfs_next_inode_with_xattrs64() 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_inode64() is overwritten by subsequent calls to gpfs_next_inode64(), gpfs_seek_inode64(), or gpfs_stat_inode64().

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_inode64(), gpfs_seek_inode64(), or gpfs_stat_inode64().

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_inodescan64() 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. Initialize this parameter to a valid value or NULL before calling gpfs_next_inode_with_xattrs64.
xattrBufLen
The returned length of the xiattr buffer. Initialize this parameter to a valid value or NULL before calling gpfs_next_inode_with_xattrs64.

Exit status

If the gpfs_next_inode_with_xattrs64() 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_xattrs64() 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
Unable to allocate memory for the request.
ENOSYS
The gpfs_next_inode_with_xattrs64() 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

See the gpfs_next_inode_with_xattrs() example in /usr/lpp/mmfs/samples/util/tsinode.c.

Location

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

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