Veritas™ File System 5.0.1 Programmer's Reference Guide
No write beyond reservation
The VX_NOEXTEND flag specifies that any attempt to write beyond the current
reservation must fail. Writing beyond the current reservation requires the
allocation of new space for the file. To allocate new space to the file, the space
reservation must be increased. This can be used similar to the function of the
ulimit command to prevent a file from using too much space.
Contiguous reservation
The VX_CONTIGUOUS flag specifies that any space allocated to a file must satisfy
the requirement of a single extent allocation. If there is not one extent large
enough to satisfy the reservation request, the request fails. For example, if a file
is created and a 1 MB contiguous reservation is requested, the file size is set to
zero and the reservation to 1 MB. The file has one extent that is 1 MB long. If
another reservation request is made for a 3 MB contiguous reservation, the new
request finds that the first 1 MB is already allocated and allocate a 2 MB extent
to satisfy the request. If there are no 2 MB extents available, the request fails.
Extents are, by definition, contiguous. Because VX_CONTIGUOUS is not a persistent
flag, space is not allocated contiguously for restoring a file that was previously
allocated with the VX_CONTIGUOUS flag.
Include reservation in the file size
A reservation request can affect the size of the file to include the reservation
amount by specifying VX_CHGSIZE. This flag increases the size of the file to match
the reservation amount without zeroing the reserved space. Because the effect of
this flag is uninitialized data in a file, which might have been previously contained
in other files, the use of this flag is restricted to users with the appropriate
privileges. Without this flag, the space of the reservation is not included in the
file until an extending write operation requires the space. A reservation that
immediately changes the file size can generate large temporary files. Applications
can benefit from this type of reservation by eliminating the overhead that is
imposed with write operations to allocate space and update the size of the file.
It is possible to use these flags in combination. For example, using VX_CHGSIZE
and VX_NORESERVE changes the file size, but does not set any reservation. When
the file is truncated, the space is freed. If the VX_NORESERVE flag is not used, the
reservation is set on the disk along with the file size.
Reading the grown part of the file
When the allocation flag (a.flag) is set to VX_GROWFILE, the size of the file is changed
to include the reservation. This flag reads the "grown" part of the file (between
Veritas File System I/O
Extents
82