Veritas™ File System 5.0.1 Programmer's Reference Guide
include <sys/fs/vx_ioctl.h>
int timeout;
int vxfs_fd;
/*
* A common mistake is to pass the address of "timeout".
* Do not pass the address of timeout, as that would be
* interpreted as a very long timeout period
*/
if (ioctl(vxfs_fd, VX_FREEZE, timeout))
{perror("ERROR: File system freeze failed");
}
For multiple file systems:
int vxfs_fd[NUM_FILE_SYSTEMS];
struct vx_freezeall freeze_info;
freeze_info.num = NUM_FILE_SYSTEMS
freeze_info.timeout = timeout;
freeze_info.fds = &vxfs_fd[0];
if (ioctl(vxfs_fd[0], VX_FREEZE_ALL, &freeze_info))
{perror("ERROR: File system freeze failed");
}
for (i = 0; i < NUM_FILE_SYSTEMS; i++)
if (ioctl(vxfs_fd[i], VX_THAW, NULL))
{perror("ERROR: File system thaw failed");
}
Caching advisories
VxFS allows an application to set caching advisories for use when accessing files.
A caching advisory is the application’s preferred choice for accessing a file. The
choice may be based on optimal performance that is achieved through the specified
advisory or to ensure integrity of user data. For example, a database application
may choose to access the files containing database data using direct I/O, or the
application may choose to benefit from the file system level caching by selecting
a buffered I/O advisory. The application chooses which caching advisory to use.
To set a caching advisory on a file, open the file first. When a caching advisory is
requested, the advisory is recorded in memory. Recording the advisory in memory
implies that caching advisories do not persist across reboots or remounts. Some
advisories are maintained on a per-file basis, not a per-file-descriptor basis. As
such, the effect of setting such an advisory through a file descriptor impacts other
processes’ access to the same file. Conflicting advisories also cannot be in effect
for accesses to the same file. If two applications set different advisories, both
73Veritas File System I/O
Caching advisories