vxfs_ap_enforce_file2.3 (1 Nov 2010)


vxfs_ap_enforce_file2 - reallocate blocks in a file to match allocation policies


For 32-bit applications:

cc -I /opt/VRTS/include -L /opt/VRTS/lib

-l vxfsutil -ldl

For 64-bit applications:

cc -I /opt/VRTS/include -L /opt/VRTS/lib/64

-l vxfsutil -ldld

For both applications:

#include <sys/types.h>

#include <vxfsutil.h>

int vxfs_ap_enforce_file2(int fd, char *datapol, char *metapol, uint32_t flags);




vxfs_ap_enforce_file2() reallocates the blocks in the file specified by fd so that all allocations for the file match the file’s current policies. In the current implementation, the datapol and metapol arguments are ignored. Applications should pass NULL for these arguments.

To use this function, specify -l vxfsutil while linking. Specify the /opt/VRTSfssdk/5.0/lib directory for 32-bit executables, or the /opt/VRTSfssdk/5.0/lib/64 directory for 64-bit executables.

If the LIBVXFSUTIL_DLL_PATH environment variable is defined, it should be set to the name of the vxfsutil.so file, such as ~/mylib/vxfsutil.so. If undefined, this variable is assumed to point to the 32-bit and 64-bit vxfsutil.so files, /opt/VRTSvxfs/lib/vxfsutil.so and /opt/VRTSvxfs/lib/64/vxfsutil.so, respectively.

Possible values for flags are:

  Additional data and metadata may be moved to improve the allocation properties of the file with respect to the policy.


This API supports file system versions 6.0 and above.


0 vxfs_ap_enforce_file2() functions as vxfs_ap_enforce_file().
FSAP_ENF_STRICT Strictly enforces the FSAP_ORDER_ASGIVEN and FSAP_ORDER_BALANCE allocation orders.


vxfs_ap_enforce_file2() returns zero on success, non-zero on failure.


EFAULT One or more of the specified pointer arguments points to an illegal address.
EIO An I/O error occurred during the operation.
ENOENT One or more of the named policies does not exist.
ENOSPC There was not enough space in the appropriate volumes to hold all the blocks of this file.
ENOSYS There is no license installed to allow this operation.
ENOTSUP This operation is not supported by the disk layout version of the specified file system. Use vxupgrade(1m) to enable this operation.
EPERM The effective user ID of the calling process does not have appropriate privileges to perform this operation.
EROFS The specified file system is mounted read-only.


vxfs_ap_assign_ckpt(3), vxfs_ap_assign_file(3), vxfs_ap_assign_fs(3), vxfs_ap_define(3), vxfs_ap_define2(3), vxfs_ap_remove(3), vxfs_ap_enforce_file(3), vxfs_ap_enumerate(3), vxfs_ap_enumerate2(3), vxfs_ap_query(3), vxfs_ap_query2(3), vxfs_ap_query_ckpt(3), vxfs_ap_query_file(3), vxfs_ap_query_fs(3), vxfs_vol_add(3), vxfs_vol_deencapsulate(3), vxfs_vol_encapsulate(3), vxfs_vol_enumerate(3), vxfs_vol_remove(3), vxfs_vol_resize(3), vxfs_vol_stat(3)

SunOS 5.9 vxfs_ap_enforce_file2.3 (1 Nov 2010)