dm_set_dmattr_nosync

Asynchronously creates or replaces the value of the named attribute with the specified data.

Synopsis

int dm_set_dmattr_nosync(
    dm_sessid_t     sid,
    void           *hanp,
    size_t          hlen,
    dm_token_t      token,
    dm_attrname_t  *attrnamep,
    int             setdtime,
    size_t          buflen,
    void           *bufp
);

Description

Use the dm_set_dmattr_nosync function to asynchronously create or replace the value of the named attribute with the specified data.

dm_set_dmattr_nosync is a GPFS-specific DMAPI function; it is not part of the open standard. It has the same purpose, parameters, and return values as the standard DMAPI dm_set_dmattr function, except that the update that it performs is not persistent until some other activity on that file (or on other files in the file system) happens to flush it to disk. To be certain that your update is made persistent, use one of the following functions:
  • Standard DMAPI dm_sync_by_handle function, which flushes the file data and attributes
  • GPFS-specific dm_sync_dmattr_by_handle function, which flushes only the attributes.

Parameters

dm_sessid_t sid (IN)
The identifier for the session of interest.
void *hanp (IN)
The handle for the file for which the attributes should be created or replaced.
size_t hlen (IN)
The length of the handle in bytes.
dm_token_t *token (IN)
The token referencing the access right for the handle. The access right must be DM_RIGHT_EXCL, or the token DM_NO_TOKEN may be used and the interface acquires the appropriate rights.
dm_attrname_t *attrnamep (IN)
The attribute to be created or replaced.
int setdtime (IN)
If setdtime is non-zero, updates the file's attribute time stamp.
size_t buflen (IN)
The size of the buffer in bytes.
void *bufp (IN)
The buffer containing the attribute data.

Return values

Zero is returned on success. On error, -1 is returned, and the global errno is set to one of the following values:
[E2BIG]
The attribute value exceeds one of the implementation defined storage limits.
[E2BIG]
buflen is larger than the implementation defined limit. The limit can be determined by calling the dm_get_config() function.
[EACCES]
The access right referenced by the token for the handle is not DM_RIGHT_EXCL.
[EBADF]
The file handle does not refer to an existing or accessible object.
[EFAULT]
The system detected an invalid address in attempting to use an argument.
[EIO]
An attempt to write the new or updated attribute resulted in an I/O error.
[EINVAL]
The argument token is not a valid token.
[EINVAL]
The session is not valid.
[ENOMEM]
The DMAPI could not acquire the required resources to complete the call.
[ENOSPC]
An attempt to write the new or updated attribute resulted in an error due to no free space being available on the device.
[ENOSYS]
The DMAPI implementation does not support this optional function.
[EPERM]
The caller does not hold the appropriate privilege.
[EROFS]
The operation is not allowed on a read-only file system.

See also

dm_remove_dmattr_nosync, dm_sync_dmattr_by_handle