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 applications use the last advisory that was set on the file. VxFS does not coordinate or prioritize advisories.
Some advisories are not cleared from memory after the last close of the file. Recorded advisories remain in memory for as long as the file system metadata used to manage access to the file remains in memory. Removing file system metadata for the file from memory is not predictable.
The caching advisories are described in the following sections.