test veritas logo



vxfs_ts_reclaim - reclaim the storage on a file system


cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl

#include <sys/types.h>

#include <vxfsutil.h>

int vxfs_ts_reclaim(char *mountpoint, uint64_t offset, uint64_t length, int32_t volindex, uint64_t unit_size, uint64_t *bytes_reclaimed, uint32_t flag);




vxfs_ts_reclaim() reclaims the free storage on a file system, and is supported only on a VxVM volume on a Thin Storage-capable LUN. The vxfs_ts_reclaim() API is non-reentrant. This API cannot be called when an instance the fsadm command or a reorg of the file system is running.


VxFS may align the offset and length internally for correctness.

Thin Storage Reclamation is a slow process and may take over an hour to complete.


mountpoint The pathname of the VxFS file system mounted on a VxVM volume.
offset The offset in bytes in the volume from which to start reclamation.
length The length in bytes from offset, up to which to reclaim free storage.
volindex The index of the volume in a volume set. When volindex has a value of -1, all the volumes in the file system ignore offset and length. On a non-multi-volume file system, volindex should be zero.
unit_size Reclaim requests greater than or equal to unit_size are issued by the file system to VxVM. Each Thin Storage Reclamation array supports reclamation by a factor of some unit size.
bytes_reclaimed Returns the number of bytes that the file system attempted to reclaim. The value does not give an indication of the number of bytes actually reclaimed.
flag Possible value for flag is:
  Initiates the TRIM command on an underlying SSD volume. In the case of a volume set, the command works only for SSD volumes.
  Initiates Thin Reclamation on a Thin Reclaimable volume. In the case of a volume set, the command works only for Thin Reclaimable volumes.
  Perform an additional data and metadata reorganization to maximize free space reclamation. This operation might trigger additional space allocation from the underlying Thin Storage, which is released at the end of the operation. This operation can fragment existing large allocations.
Aggressive reclamation is performed only if VxVM reports the volume as thinrclm. In case of multi-volume file systems, only the volumes that VxVM reports as thinrclm are considered.
If the volindex argument has a value of -1, then the full file system is covered. The offset and length arguments are ignored. If you specify a value for the volindex argument, then the full volume is covered if both the offset argument and length argument have a value of 0. If you specify a value for the offset argument and length argument, vxfs_ts_reclaim() does not perform aggressive reclamation, but performs the default reclamation instead, regardless if you specified a value for the volindex argument.
  Perform an analysis of the file system to recommend whether you should use Normal Reclaim or Aggressive Reclaim. You can use either reclaim policy regardless of the recommendation. The return values are negative and specify the recommended reclaim operation. vxfs_ts_reclaim() returns -2 if Normal Reclaim is advised, and -3 if Aggressive Reclaim is advised.
  Perform an analysis of the file system determine which reclaim policy is suitable at this point and, depending upon the analysis, execute the policy on behalf of the user.
  Perform multi-threaded Thin Storage Reclamation.


vxfs_ts_reclaim() returns zero on success, and non-zero on failure.


EPERM The API was called by a non-root user.
ENOENT The mount point does not exist.
EBADF The mount point is not the root of the file system.
EPIPE The device for the mount point cannot be accessed.
ENOTSUP The mount point is not the root of a VxFS file system, the specified volume is not thinrclm-capable, or none of the volumes in the volume set are thinrclm-capable.
ENOMEM Memory could not be allocated during the operation of the API.
EBUSY The metadata on the file system could not be modified.
ENXIO The specified device does not exist.
EINVAL The specified offset or length is invalid.
EAGAIN Another fsadm or reorg instance is running.
EFAULT The reclaim operation failed due to other system-related issues.



VxFS 8.0 vxfs_ts_reclaim(3)