Symantec logo



vxfsio - VxFS file system control functions


cc -I /opt/VRTS/include -L /opt/VRTS/lib
-l vxfsutil -ldl

cc -I /opt/VRTSvxfs/include -L /opt/VRTSvxfs/lib/sparcv9
-l vxfsutil -ldl

#include <sys/types.h>
#include <sys/fs/vx_ioctl.h>

int ioctl (int fildes, int cmd, arg);




The VxFS ioctl(2) enhancements provide extended control for open files.

The requirements for direct I/O are as follows:

If the I/O is performed using the readv(2) and writev(2) system calls, these restrictions apply to each element of the array of struct iovec.

The argument fildes is an open file descriptor. The data type and value of arg are specific to the type of command specified by cmd.

The symbolic names for commands and file status flags are defined by the sys/fs/vx_ioctl.h header file. The available VxFS ioctls are:

The VX_GETFSOPT ioctl returns a zero if the file system options are successfully obtained. If the operation fails, the return value is -1 and the external variable errno is a general DIAGNOSTIC.


Gets the I/O parameters for optimized application I/O. The argument arg points to a structure of type vx_ioparameters as defined in sys/fs/vxio.h. The optimal I/O request sizes for applications using direct or discovered direct I/O are returned in this structure. Applications using buffered I/O must use a multiple of the st_blksize value returned by stat for their I/O requests. The VX_GET_IOPARAMETERS ioctl returns a zero if the parameters are successfully obtained. If the operation fails, the return value is -1 and the external variable errno is a general DIAGNOSTIC.

The fields in the vx_ioparameters structure are:

unsigned vi_read_preferred_io; /* preferred read size in bytes */

unsigned vi_read_nstream; /* num of preferred reads to stream */

unsigned vi_read_unit_io; /* less preferred read size in bytes */

unsigned vi_write_preferred_io; /* preferred write size in bytes */

unsigned vi_write_nstream; /* num of preferred writes to stream */

unsigned vi_write_unit_io; /* less preferred write size in bytes */

unsigned vi_pref_strength; /* strength of preferences */

unsigned vi_breakup_size; /* I/O breakup size in bytes */

unsigned vi_align_offset; /* adj for alignment calculations */

dev_t vi_block_device; /* bdev number for this cdev */

For an application to do the most efficient direct I/O or discovered direct I/O, read requests should be equal to the product of vi_read_nstream multiplied by vi_read_preferred_io. In general, any multiple or factor of vi_read_nstream multiplied by vi_read_preferred_io is a size for good performance. For writing, the same formula applies to the vi_write_preferred_io and vi_write_nstream parameters.

If an application is doing sequential I/O to large files, it issues a request larger than the discovered direct I/O size for the file system. This causes the I/O requests to be performed as discovered direct I/O requests (which are unbuffered like direct I/O but do not require synchronous inode updates when extending the file). If the file is larger than the cache size, use unbuffered I/O to reduce CPU overhead and to removing useful data from the cache. See the vxtunefs(1M) manual page for more information on discovered direct I/O.


Operation failures can return any of the following values in errno:


The calling process does not have write access to the file specified by fildes.


The file system is not currently frozen.


The fildes argument is not a valid file descriptor open for writing.


An address specified by an argument is invalid.


An attempt was made to reserve space larger than the maximum file size limit for this process.


The command or argument is invalid.


An I/O error occurred while attempting to perform the operation.


The file specified by fildes is not the root directory of a VxFS file system.


Requested space could not be obtained.


The process does not have appropriate privilege.


The file system is mounted read-only.


The VX_FREEZE timeout expired before this call.


In some cases, fsadm may reorganize the extent map of a file in such a way as to make it less contiguous. However, it does not change the geometry of a file that has a fixed extent size.


fsadm_vxfs(1M), vxtunefs(1M), fcntl(2), getrlimit(2), ioctl(2), ulimit(2)