gpfs_fputattrswithpathname() subroutine
Sets all of the extended file attributes for a file and invokes the policy engine for RESTORE rules.
Library
GPFS™ Library (libgpfs.a for AIX®, libgpfs.so for Linux)
Synopsis
#include <gpfs.h>
int gpfs_fputattrswithpathname(gpfs_file_t fileDesc,
int flags,
void *bufferP,
const char *pathName);
Description
The gpfs_fputattrswithpathname() subroutine sets all of the extended attributes of a file. In addition, gpfs_fputattrswithpathname() invokes the policy engine using the saved attributes to match a RESTORE rule to set the storage pool and the data replication for the file. The caller should include the full path to the file (including the file name) to allow rule selection based on file name or path. If the file fails to match a RESTORE rule or if there are no RESTORE rules installed, GPFS selects the storage pool and data replication as it does when calling gpfs_fputattrs().
- libgpfs.a for AIX
- libgpfs.so for Linux
Parameters
- fileDesc
- Is the file descriptor that identifies the file whose extended attributes are to be set.
- flags
- Must
have one of the following values:
- GPFS_ATTRFLAG_DEFAULT
- Uses the saved attributes to match a RESTORE rule to set the storage pool and the data replication for the file.
- GPFS_ATTRFLAG_NO_PLACEMENT
- Does not change storage pool and data replication.
- GPFS_ATTRFLAG_IGNORE_POOL
- Checks the file to see if it matches a RESTORE rule. If the file fails to match a RESTORE rule, GPFS ignores the saved storage pool and selects a pool by matching the saved attributes to a PLACEMENT rule.
- 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.
- Non-placement attributes such as ACLs are always restored, regardless of value of the flag.
- bufferP
- A pointer to the buffer containing the extended attributes for
the file.
If you specify a value of NULL, all extended ACLs for the file are deleted.
- pathName
- A pointer to the path name to a file or directory.
Exit status
If the gpfs_fputattrswithpathname() subroutine is successful, it returns a value of 0.
If the gpfs_fputattrswithpathname() 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:
- EBADF
- The file descriptor is not valid.
- EINVAL
- The buffer to which bufferP points does not contain valid attribute data.
- ENOENT
- No such file or directory.
- ENOSYS
- The gpfs_fputattrswithpathname() subroutine is not supported under the current file system format.
Examples
Refer to gpfs_fputattrs() subroutine for examples.
Location
/usr/lpp/mmfs/lib/libgpfs.a for AIX
/usr/lpp/mmfs/lib/libgpfs.so for Linux