How to use extent attribute APIs

First, verify that the target file system is VxFS, and then determine the file system block size using the statfs() call. The type for VxFS is MNT_VXFS on most platforms, and the file system block size is returned in statfs.f_bsize. The block size must be known for setting or interpreting the extent attribute information through VxFS extent attribute APIs.

Each invocation of the VX_SETEXT ioctl affects all the elements in the vx_ext structure.

To use VX_SETEXT

  1. Call the VX_GETEXT ioctl to read the current settings, if any.
  2. Modify the current values to be changed.
  3. Call the VX_SETEXT ioctl to set the new values.

Warning:

Follow this procedure carefully. A fixed extent size may be inadvertently cleared when the reservation is changed. When copying files between VxFS and non-VxFS file systems, the extent attributes cannot be preserved. The attribute values returned for a file in a vx_ext structure have a different effect on another VxFS file system with a different file system block size from the source file system. Translation of attribute values for different block sizes may be necessary when copying files with attributes between two file systems of a different block size.