vnop_fsync, vnop_fsync_range Entry Points
Purpose
Flushes file data from memory to disk.
Syntax
Parameters
| Item | Description | 
|---|---|
| vp | Points to the virtual node (v-node) of the file. | 
| flags |   Identifies flags from the open file and the
flags that govern the action to be taken. It can be one of the following
values: 
  | 
| vinfo | This parameter is currently not used. | 
| offset | Specifies the starting offset in the file of the data to be flushed. | 
| length | Specifies the length of the data to be flushed. If you specify the value as zero, all cached data is flushed. | 
| crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. | 
Description
The vnop_fsync entry point is called by the logical file system to request that all modifications associated with a given v-node to be flushed out to permanent storage. This must be done synchronously so that the caller can assure that all I/O has completed successfully. The vnop_fsync_range entry point provides the same function but limits the data to be written to a specified range in the file.
Execution Environment
The vnop_fsync and vnop_fsync_range entry points can be called from the process environment only.
Return Values
| Item | Description | 
|---|---|
| 0 | Indicates success. | 
Nonzero values are returned from the /usr/include/sys/errno.h file to indicate failure.