gpfs_get_fssnaphandle_by_name() subroutine

Obtains a file system snapshot handle using its name.

Library

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

Synopsis

#include <gpfs.h>
gpfs_fssnap_handle_t *gpfs_get_fssnaphandle_by_name(const char *fsName,
                                                    const char *snapName);

Description

The gpfs_get_fssnaphandle_by_name() subroutine creates a handle for the file system or snapshot that is uniquely identified by the file system's name and the name of the snapshot.

Note: Compile any program that uses this subroutine with the -lgpfs flag from the following library:
  • libgpfs.a for AIX
  • libgpfs.so for Linux

Parameters

fsName
A pointer to the name of the file system whose snapshot handle is desired.
snapName
A pointer to the name of the snapshot whose snapshot handle is desired, or NULL to access the active file system rather than a snapshot within the file system.

Exit status

If the gpfs_get_fssnaphandle_by_name() subroutine is successful, it returns a pointer to the file system snapshot handle.

If the gpfs_get_fssnaphandle_by_name() subroutine is unsuccessful, it returns NULL 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:

ENOENT
The file system name is not valid.
ENOMEM
Space could not be allocated for the file system snapshot handle.
ENOSYS
The gpfs_get_fssnaphandle_by_name() subroutine is not available.
EPERM
The caller does not have superuser privileges.
GPFS_E_INVAL_SNAPNAME
The snapshot name is not valid.

Examples

For an example using gpfs_get_fssnaphandle_by_name(), 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