HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man7/!!!intro.7
________________________________________________________________
___ ___
v
vxfsio(7) vxfsio(7)
VX_GET_IOPARAMETERS
Get 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 appli-
cations using direct or discovered direct I/O are returned in this structure. Applications using
buffered I/O should use the st_blksize value returned ty 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 will be a general DIAGNOS-
TIC.
The fields in the vx_ioparameters structure are:
size_t vi_read_preferred_io; /* preferred read size in bytes */
size_t vi_read_nstream; /* num of preferred reads to stream */
size_t vi_read_unit_io; /* less preferred read size in bytes */
size_t vi_write_preferred_io; /* preferred write size in bytes */
size_t vi_write_nstream; /* num of preferred writes to stream */
size_t vi_write_unit_io; /* less preferred write size in bytes */
size_t vi_pref_strength; /* strength of preferences */
size_t vi_breakup_size; /* I/O breakup size in bytes */
size_t vi_align_offset; /* adj for alignment calculations */
dev_t vi_block_device; /* bdev number for this cdev */
An application that tries to do efcient direct I/O or discovered direct I/O should issue read requests
that are equal to the product of vi_read_nstream
multiplied by vi_read_preferred_io.
Generally any multiple or factor of
vi_read_nstream
multiplied by
vi_read_preferred_io
should be a good size for performance. For writing, the same rule of
thumb applies to the
vi_write_preferred_io
and vi_write_nstream parameters.
If an application is doing sequential I/O to large les, it should try to issue request larger than the
discovered direct I/O size for the file system. This will cause 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 le). If the file is larger than will fit in the cache, then using
unbuffered I/O will avoid throwing a lot of useful data out of the cache and it will avoid a lot of CPU
overhead. See the vxtunefs(1M) manual page for more information on discovered direct I/O.
EXAMPLES
The following example shows how application code can use
VX_GETFSOPT to find out if a JFS file system
was mounted with the -o delaylog option:
struct vx_genioctl ioc;
int arg = 0;
int fd;
ioc.ioc_cmd = VX_GETFSOPT;
ioc.ioc_up = &arg;
ioctl(fd, VX_ADMIN_IOCTL, &ioc);
if (arg & VX_FSO_DELAYLOG) {
printf("FS mounted with delaylog option!\n");
}
DIAGNOSTICS
Operation failures can return any of the following values in errno:
EACCESS The calling process does not have write access to the file specified by
fildes.
EAGAIN The file system is not currently frozen.
EFAULT An address specified by an argument is invalid.
EFBIG An attempt was made to reserve space larger than the maximum file size limit for this pro-
cess.
EINVAL The command or argument is invalid.
EIO An I/O error occurred while attempting to perform the operation.
ENODEV The file specified by fildes is not the root directory of a
vxfs file system.
ENOSPC Requested space could not be obtained.
HP-UX Release 11i: December 2000 5 Section 7193
___
___