Veritas™ File System 5.0.1 Programmer's Reference Guide
is less than the reservation amount, space is allocated to the file from the current
file size up to the reservation amount. When the file is truncated, space below the
reserved amount is not freed.
Fixed extent size
VxFS uses the I/O size of write requests and the default allocation policy for
allocating space to a file. For some applications, the default allocation policy may
not be optimal. Setting a fixed extent size on a file overrides the default allocation
policies for that file. Applications can set a fixed extent size to match the
application I/O size so that all new extents allocated to the file are of the fixed
size. By using a fixed extent size, an application can reduce allocation attempts
and guarantee optimal extent sizes for a file. With the fixed extent size attribute,
an extending write operation will trigger VxFS to extend the previously allocated
extent by the fixed extent size amount to maintain contiguity of the extent. If the
last extent cannot be extended by the fixed extent size amount, a new disjoint
extent is allocated. The size of a fixed extent should factor in the size of file I/O
appropriate to the application. Do not use small fixed extent size to eliminate the
advantage with extent-base allocation policies.
Another use of a fixed extent size occurs with sparse files. VxFS usually performs
I/O in multiples of the system-defined page size. When allocating to a sparse file,
VxFS allocates space in multiples of the page size according to the amount of page
I/O in need of allocation. If the application always does sub-page I/O, the use of
fixed extent size in multiples of the page size reduces allocations.
Applications should not use a large fixed extent size. Allocating a large fixed
extent may fail due to the unavailability of an extent of that size, whereas smaller
extents are more readily available for allocation.
Custom applications may also use fixed extent sizes for specific reasons, such as
the need to align extents to cylinder or striping boundaries on disk.
The fixed extent size attribute is specified in units of file system block size. The
attribute specifies the number of contiguous file system blocks to allocate for a
new extent, or the number of contiguous blocks to allocate and append to the end
of an existing extent. A file with this attribute has fixed size extents or larger
extents that are a multiple of the fixed size extent.
Application programming interface for extent attributes
The current API for extent attributes is ioctl(). Applications can open a file and
use the returned file descriptor with calls to ioctl() to retrieve, set, or change
extent attributes. To set or change existing extent attributes, use the VX_SETEXT
ioctl. To retrieve existing extent attributes, if any, use the VX_GETEXT ioctl.
79Veritas File System I/O
Extents