|VOP_ADVISE(9)||FreeBSD Kernel Developer's Manual||VOP_ADVISE(9)|
NAMEVOP_ADVISE — apply advice about use of file data
SYNOPSIS#include < sys/param.h>
#include < sys/vnode.h>
VOP_ADVISE( struct vnode *vp, off_t start, off_t end, int advice);
DESCRIPTIONThis call applies advice for a range of a file's data. It is used to implement the posix_fadvise system call.
Its arguments are:
- The vnode of the file.
- The start of the range of file data.
- The end of the range of file data.
The type of operation to apply to the file data. Possible values are:
- Initiate an asynchronous read of the file data if it is not already resident.
- Decrease the in-memory priority of clean file data or discard clean file data.
If the start and end offsets are both zero, then the operation should be applied to the entire file. Note that this call is advisory only and may perform the requested operation on a subset of the requested range (including not performing it at all) and still return success.
LOCKSThe file should be unlocked on entry.
RETURN VALUESZero is returned if the call is successful, otherwise an appropriate error code is returned.
- [ EINVAL]
- An invalid value was given for advice.
|October 3, 2013||FreeBSD|