gpfs_igetattrsx() subroutine

Retrieves extended file attributes; provides an option to include DMAPI attributes.

Library

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

Synopsis

#include <gpfs.h>
int gpfs_igetattrsx(gpfs_ifile_t *ifile, 
                    int flags, 
                    void *buffer, 
                    int bufferSize, 
                    int *attrSize);

Description

The gpfs_igetattrsx() subroutine retrieves all extended file attributes in opaque format. It provides the same function as gpfs_igetattrs() but includes a flags parameter that allows the caller to back up and restore DMAPI attributes.

This function is intended for use by a backup program to save (and restore, using the related subroutine gpfs_iputattrsx()) all extended file attributes (ACLs, user attributes, and so forth) in one call. If the file does not have any extended attributes, the subroutine sets attrSize to zero.

Notes:
  1. This call can optionally return extended attributes used for the Data Storage Management (XDSM) API (also known as DMAPI).
  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

ifile
Pointer to gpfs_ifile_t from gpfs_iopen().
flags
Flags must have one of the following values:
GPFS_ATTRFLAG_NO_PLACEMENT
File attributes for placement are not saved, and neither is the current storage pool.
GPFS_ATTRFLAG_IGNORE_PLACEMENT
File attributes for placement are saved, but the current storage pool is not.
GPFS_ATTRFLAG_INCL_DMAPI
File attributes for DMAPI are included in the returned buffer.
GPFS_ATTRFLAG_USE_POLICY
Uses the restore policy rules to determine the pool ID.
GPFS_ATTRFLAG_INCL_DMAPI
Includes the DMAPI attributes.
GPFS_ATTRFLAG_FINALIZE_ATTRS
Finalizes immutability attributes.
GPFS_ATTRFLAG_SKIP_IMMUTABLE
Skips immutable attributes.
GPFS_ATTRFLAG_INCL_ENCR
Includes encryption attributes.
GPFS_ATTRFLAG_SKIP_CLONE
Skips clone attributes.
GPFS_ATTRFLAG_MODIFY_CLONEPARENT
Allows modification on the clone parent.
buffer
A pointer to the buffer for returned attributes.
bufferSize
Size of the buffer.
attrSize
Pointer to returned size of attributes.

Exit status

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

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

EINVAL
Not a GPFS file, or the flags provided are not valid.
ENOSPC
The buffer is too small to return all attributes. Field attrSize will be set to the size necessary.
ENOSYS
The gpfs_igetattrsx() subroutine is not available.

Location

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

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