VOP_ADVISE (9)
Leading comments
Copyright (c) 2013 Hudson River Trading LLC Written by: John H. Baldwin <jhb@FreeBSD.org> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and t...
NAME
VOP_ADVISE - apply advice about use of file dataSYNOPSIS
In sys/param.h In sys/vnode.h Ft int Fn VOP_ADVISE struct vnode *vp off_t start off_t end int adviceDESCRIPTION
This call applies advice for a range of a file's data. It is used to implement the posix_fadvise system call.Its arguments are:
- Fa vp
- The vnode of the file.
- Fa start
- The start of the range of file data.
- Fa end
- The end of the range of file data.
- Fa advice
-
The type of operation to apply to the file data.
Possible values are:
- POSIX_FADV_WILLNEED
- Initiate an asynchronous read of the file data if it is not already resident.
- POSIX_FADV_DONTNEED
- Decrease the in-memory priority of clean file data or discard clean file data.
If the Fa start and Fa 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.
LOCKS
The file should be unlocked on entry.RETURN VALUES
Zero is returned if the call is successful, otherwise an appropriate error code is returned.ERRORS
- Bq Er EINVAL
- An invalid value was given for Fa advice .