dm_set_region_nosync

Asynchronously replaces the set of managed regions for a file.

Synopsis

int dm_set_region_nosync(
    dm_sessid_t     sid,
    void           *hanp,
    size_t          hlen,
    dm_token_t      token,
    u_int           nelem,
    dm_region_t    *regbufp,
    dm_boolean_t   *exactflagp
);

Description

Use the dm_set_region_nosync function to asynchronously replace the set of managed regions for a file.

dm_set_region_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_region 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 regular file to be affected.
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.
u_int nelem (IN)
The number of input regions in regbufp. If nelem is 0, then all existing managed regions are cleared.
dm_region_t *regbufp (IN)
A pointer to the structure defining the regions to be set. May be NULL if nelem is zero.
dm_boolean_t *exactflagp (OUT)
If DM_TRUE, the file system did not alter the requested managed region set.
Valid values for the rg_flags field of the region structure are created by OR'ing together one or more of the following values:
DM_REGION_READ
Enable synchronous event for read operations that overlap this managed region.
DM_REGION_WRITE
Enable synchronous event for write operations that overlap this managed region.
DM_REGION_TRUNCATE
Enable synchronous event for truncate operations that overlap this managed region.
DM_REGION_NOEVENT
Do not generate any events for this managed region.

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 number of regions specified by nelem exceeded the implementation capacity.
[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.
[EINVAL]
The argument token is not a valid token.
[EINVAL]
The file handle does not refer to a regular file.
[EINVAL]
The regions passed in are not valid because they overlap or some other problem.
[EINVAL]
The session is not valid.
[EIO]
An I/O error resulted in failure of operation.
[ENOMEM]
The DMAPI could not acquire the required resources to complete the call.
[EPERM]
The caller does not hold the appropriate privilege.
[EROFS]
The operation is not allowed on a read-only file system.

See also

dm_sync_dmattr_by_handle