gpfs_stat_inode() subroutine
Seeks the specified inode and retrieves that 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_stat_inode(gpfs_iscan_t *iscan,
gpfs_ino_t ino,
gpfs_ino_t termIno,
const gpfs_iattr_t **iattr);
Description
The gpfs_stat_inode() subroutine is used to seek the specified inode and to retrieve that inode and its extended attributes from the inode scan. This subroutine combines gpfs_seek_inode() and get_next_inode(), but will only return the specified inode.
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. It is only used by this call to control prefetching.
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- iscan
- A pointer to an inode scan descriptor.
- ino
- The inode number to be returned.
- termIno
- Prefetches inodes up to this inode. The caller might specify maxIno from gpfs_open_inodescan() or 0 to allow prefetching over the entire inode file.
- iattr
- A pointer to the returned pointer to the file's iattr.
Exit status
If the gpfs_stat_inode() subroutine is successful, it returns a value of 0 and the iattr parameter is set to point to gpfs_iattr_t. If the gpfs_stat_inode() subroutine is successful, but there are no more inodes before the termIno parameter, or if the requested inode does not exist, it returns a value of 0 and the iattr parameter is set to NULL.
If the gpfs_stat_inode() subroutine is unsuccessful, it returns a value of -1 and sets the global error variable errno to indicate the nature of the error.
Exceptions
None.
Error status
Error codes include but are not limited to the following:
- EPERM
- The caller must have superuser privilege.
- ENOSYS
- The gpfs_stat_inode() subroutine is not supported under the current file system format.
- ESTALE
- The cached file system information was not valid.
- ENOMEM
- The buffer is too small.
- GPFS_E_INVAL_ISCAN
- Incorrect parameters.
- GPFS_E_HOLE_IN_IFILE
- The inode scan is reading only the inodes that have been copied to a snapshot and this inode has not yet been copied.
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux