Please enter search query.
Search <book_title>...
Veritas™ File System Programmer's Reference Guide - Solaris
Last Published:
2018-08-24
Product(s):
InfoScale & Storage Foundation (7.2)
Platform: Solaris
- Veritas File System software developer's kit
- File Change Log
- About the File Change Log file
- Record types
- File Change Log tunables
- Application programming interface for File Change Log
- API functions
- File Change Log record
- Copying File Change Log records
- Veritas File System and File Change Log upgrade and downgrade
- Reverse path name lookup
- Multi-volume support
- Named data streams
- Veritas File System I/O
- Caching advisories
- Extents
- Thin Reclamation
Index maintenance application
This sample application is for a system that maintains an index of all files in the file system to enable a fast search similar to the locate program in Linux. The system needs to update the index periodically, or as required with respect to the file changes since the last index update. The following lists the basic steps to perform and shows a sample call to the FCL API.
To prepare the application
- Enable the FCL.
$ fcladm on mount_point
- Tune fcl_keeptime and fcl_maxalloc to the required values.
$ vxtunefs -o fcl_keeptime=value mount_point $ vxtunefs -o fcl_maxalloc=value mount_point
To test the application
- Open the FCL file.
$ vxfs_fcl_open(mount_point, 0, &fh);
- Seek to the end.
$ vxfs_fcl_seek(fh, NULL, FCL_SEEK_END);
- Get the cookie and store it in a file.
$ vxfs_fcl_getcookie(fh, &cookie) write(fd, cookie, sizeof(struct fcl_cookie));
- Create the index.
To update the application
- Open the FCL file.
$ vxfs_fcl_open(mount_point, 0, &fh);
- Read the cookie and seek to the cookie.
$ read(fd, &cookie, sizeof(struct fcl_cookie)) $ vxfs_fcl_seek(fh, cookie, FCL_SEEK_COOKIE)
- Read the FCL file and update the index accordingly.
$ vxfs_fcl_read(fh, buf, BUFSZ, FCL_ALL_v4_EVENTS, &nentries)
- Get the cookie and store it back in the file.
$ vxfs_fcl_getcookie(fh, &cookie) $ write(fd, cookie, sizeof(struct fcl_cookie));