]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man9/VOP_ADVISE.9
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man9 / VOP_ADVISE.9
1 .\" -*- nroff -*-
2 .\"
3 .\" Copyright (c) 2013 Advanced Computing Technologies LLC
4 .\" Written by: John H. Baldwin <jhb@FreeBSD.org>
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
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.
15 .\"
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
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd October 3, 2013
31 .Dt VOP_ADVISE 9
32 .Os
33 .Sh NAME
34 .Nm VOP_ADVISE
35 .Nd apply advice about use of file data
36 .Sh SYNOPSIS
37 .In sys/param.h
38 .In sys/vnode.h
39 .Ft int
40 .Fn VOP_ADVISE "struct vnode *vp" "off_t start" "off_t end" "int advice"
41 .Sh DESCRIPTION
42 This call applies advice for a range of a file's data.
43 It is used to implement the
44 .Xr posix_fadvise
45 system call.
46 .Pp
47 Its arguments are:
48 .Bl -tag -width offset
49 .It Fa vp
50 The vnode of the file.
51 .It Fa start
52 The start of the range of file data.
53 .It Fa end
54 The end of the range of file data.
55 .It Fa advice
56 The type of operation to apply to the file data.
57 Possible values are:
58 .Bl -tag -width POSIX_FADV_WILLNEED
59 .It Dv POSIX_FADV_WILLNEED
60 Initiate an asynchronous read of the file data if it is not already resident.
61 .It Dv POSIX_FADV_DONTNEED
62 Decrease the in-memory priority of clean file data or discard clean file data.
63 .El
64 .El
65 .Pp
66 If the
67 .Fa start
68 and
69 .Fa end
70 offsets are both zero,
71 then the operation should be applied to the entire file.
72 Note that this call is advisory only and may perform the requested
73 operation on a subset of the requested range
74 .Pq including not performing it at all
75 and still return success.
76 .Sh LOCKS
77 The file should be unlocked on entry.
78 .Sh RETURN VALUES
79 Zero is returned if the call is successful, otherwise an appropriate
80 error code is returned.
81 .Sh ERRORS
82 .Bl -tag -width Er
83 .It Bq Er EINVAL
84 An invalid value was given for
85 .Fa advice .
86 .El
87 .Sh SEE ALSO
88 .Xr vnode 9