Veritas™ File System 5.0.1 Programmer's Reference Guide
Applications can set or change extent attributes on a file by providing the attribute
information in the structure of type vx_ext and passing the VX_SETEXT iotcl and
the address of the structure using the third argument of the ioctl() call.
Applications can also retrieve existing extent attributes, if any, by passing the
VX_GETEXT ioctl and the address of the same structure, of type vx_ext, as the third
argument with the ioctl() call.
struct vx_ext {
off_t ext_size; /* extent size in fs blocks */
off_t reserve; /* space reservation in fs blocks */
int a_flags; /* allocation flags */
}
The ext_size argument is set to specify a fixed extent size. The value of fixed extent
size is specified in units of the file system block size. Be sure the file system block
size is known before setting the fixed extent size. If a fixed extent size is not
required, use zero to allow the default allocation policy to be used for allocating
extents. The fixed extent allocation policy takes effect immediately after successful
execution of the VX_SETEXT ioctl. An exception is with the files that already contain
indirect blocks, in which case the fixed extent policy has no effect unless file
truncation frees all current indirect blocks.
The reserve argument can be set to specify the amount of space preallocated to a
file. The amount is specified in units of the file system block size. Be sure the file
system block size is known before setting the preallocation amount. If a file has
already been preallocated, its current reservation amount can be changed with
the VX_SETEXT ioctl. If the specified reserve amount is greater than the current
reservation, the allocation for the file is increased to match the newly specified
reserve amount. If the reserve amount is less than the current reservation, the
reservation amount is decreased and the allocation is reduced to the newly set
reservation amount or the current file size. File preallocation requires root
privilege, unless the size of the file is not changed, and the preallocation size
cannot be increased beyond the ulimit of the requesting process.
See the VX_CHGSIZE flag.
See the ulimit(2) manual page.
Allocation flags
Allocation flags can be specified with VX_SETEXT ioctl for additional control over
allocation policies.
Allocation flags are specified in the a_flag argument of vx_ext structure to
determine the following:
Veritas File System I/O
Extents
80