3 .\" Copyright (c) 2013 Hudson River Trading LLC
4 .\" Written by: John H. Baldwin <jhb@FreeBSD.org>
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .Dd September 26, 2015
35 .Nd apply advice about use of file data
40 .Fn VOP_ADVISE "struct vnode *vp" "off_t start" "off_t end" "int advice"
42 This call applies advice for a range of a file's data.
43 It is used to implement the
48 .Bl -tag -width offset
50 The vnode of the file.
52 The start of the range of file data.
54 The end of the range of file data.
57 indicates that the advice is to be applied up to the end of the file.
59 The type of operation to apply to the file data.
61 .Bl -tag -width POSIX_FADV_WILLNEED
62 .It Dv POSIX_FADV_WILLNEED
63 Initiate an asynchronous read of the file data if it is not already resident.
64 .It Dv POSIX_FADV_DONTNEED
65 Decrease the in-memory priority of clean file data or discard clean file data.
73 offsets are both zero,
74 then the operation should be applied to the entire file.
75 Note that this call is advisory only and may perform the requested
76 operation on a subset of the requested range
77 .Pq including not performing it at all
78 and still return success.
80 The file should be unlocked on entry.
82 Zero is returned if the call is successful, otherwise an appropriate
83 error code is returned.
87 An invalid value was given for