summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/VOP_ADVISE.9 4.html
blob: bed126751d6e0abd9ab5f0844357113f4f8ffb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<table class="head">
  <tr>
    <td class="head-ltitle">VOP_ADVISE(9)</td>
    <td class="head-vol">Kernel Developer's Manual</td>
    <td class="head-rtitle">VOP_ADVISE(9)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">VOP_ADVISE</code> &#x2014; <span class="Nd">apply
    advice about use of file data</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">sys/param.h</a>&gt;</code>
  <br/>
  <code class="In">#include &lt;<a class="In">sys/vnode.h</a>&gt;</code></p>
<p class="Pp"><var class="Ft">int</var>
  <br/>
  <code class="Fn">VOP_ADVISE</code>(<var class="Fa" style="white-space: nowrap;">struct
    vnode *vp</var>, <var class="Fa" style="white-space: nowrap;">off_t
    start</var>, <var class="Fa" style="white-space: nowrap;">off_t end</var>,
    <var class="Fa" style="white-space: nowrap;">int advice</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">This call applies advice for a range of a file's data. It is used
    to implement the <a class="Xr">posix_fadvise(2)</a> system call.</p>
<p class="Pp">Its arguments are:</p>
<dl class="Bl-tag">
  <dt><var class="Fa">vp</var></dt>
  <dd>The vnode of the file.</dd>
  <dt><var class="Fa">start</var></dt>
  <dd>The start of the range of file data.</dd>
  <dt><var class="Fa">end</var></dt>
  <dd>The end of the range of file data. A value of
      <code class="Dv">OFF_MAX</code> indicates that the advice is to be applied
      up to the end of the file.</dd>
  <dt><var class="Fa">advice</var></dt>
  <dd>The type of operation to apply to the file data. Possible values are:
    <dl class="Bl-tag">
      <dt id="POSIX_FADV_WILLNEED"><a class="permalink" href="#POSIX_FADV_WILLNEED"><code class="Dv">POSIX_FADV_WILLNEED</code></a></dt>
      <dd>Initiate an asynchronous read of the file data if it is not already
          resident.</dd>
      <dt id="POSIX_FADV_DONTNEED"><a class="permalink" href="#POSIX_FADV_DONTNEED"><code class="Dv">POSIX_FADV_DONTNEED</code></a></dt>
      <dd>Decrease the in-memory priority of clean file data or discard clean
          file data.</dd>
    </dl>
  </dd>
</dl>
<p class="Pp">If the <var class="Fa">start</var> and <var class="Fa">end</var>
    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.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="LOCKS"><a class="permalink" href="#LOCKS">LOCKS</a></h1>
<p class="Pp">The file should be unlocked on entry.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
  VALUES</a></h1>
<p class="Pp">Zero is returned if the call is successful, otherwise an
    appropriate error code is returned.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ERRORS"><a class="permalink" href="#ERRORS">ERRORS</a></h1>
<dl class="Bl-tag">
  <dt id="EINVAL">[<a class="permalink" href="#EINVAL"><code class="Er">EINVAL</code></a>]</dt>
  <dd>An invalid value was given for <var class="Fa">advice</var>.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">vnode(9)</a></p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">September 26, 2015</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>