gpfs_igetfilesetname() subroutine

Returns the name of the fileset defined by a fileset ID.

Library

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

Synopsis

#include <gpfs.h>
int gpfs_igetfilesetname(gpfs_iscan_t *iscan,
                         unsigned int filesetId,
                         void *buffer, 
                         int bufferSize); 

Description

The gpfs_igetfilesetname() subroutine is part of the backup by inode interface. The caller provides a pointer to the scan descriptor used to obtain the fileset ID. This library routine will return the name of the fileset defined by the fileset ID. The name is the null-terminated string provided by the administrator when the fileset was defined. The maximum string length is GPFS_MAXNAMLEN, which is defined in /usr/lpp/mmfs/include/gpfs.h.

Notes:
  1. This routine is not thread safe. Only one thread at a time is allowed to invoke this routine for the given scan descriptor.
  2. Compile any program that uses this subroutine with the -lgpfs flag from the following library:
    • libgpfs.a for AIX
    • libgpfs.so for Linux

Parameters

iscan
Pointer to gpfs_iscan_t used to obtain the fileset ID.
filesetId
The fileset ID.
buffer
Pointer to buffer for returned attributes.
bufferSize
Size of the buffer.

Exit status

If the gpfs_igetfilesetname() subroutine is successful, it returns a value of 0.

If the gpfs_igetfilesetname() 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:

E2BIG
The buffer is too small to return the fileset name.
EINTR
The call was interrupted. This routine is not thread safe.
EINVAL
The fileset ID is not valid.
ENOMEM
Unable to allocate memory for the request.
ENOSYS
The gpfs_igetfilesetname() 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
The iscan parameters were not valid.

Examples

This programming segment gets the fileset name based on the given fileset ID. The returned fileset name is stored in FileSetNameBuffer, which has a length of FileSetNameSize.

gpfs_iscan_t *fsInodeScanP;
gpfs_igetfilesetname(fsInodeScanP,FileSetId, &FileSetNameBuffer,FileSetNameSize); 

Location

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

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