blob: e4a4b73af82969e21f3c92d3ad9da516d094bfb0 (
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
88
89
90
91
92
93
94
95
96
97
98
99
|
<table class="head">
<tr>
<td class="head-ltitle">VOP_DEALLOCATE(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">VOP_DEALLOCATE(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_DEALLOCATE</code> —
<span class="Nd">zero and/or deallocate storage from a file</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
<<a class="In">sys/param.h</a>></code>
<br/>
<code class="In">#include <<a class="In">sys/vnode.h</a>></code></p>
<p class="Pp"><var class="Ft">int</var>
<br/>
<code class="Fn">VOP_DEALLOCATE</code>(<var class="Fa">struct vnode *vp</var>,
<var class="Fa">off_t *offset</var>, <var class="Fa">off_t *len</var>,
<var class="Fa">int flags</var>, <var class="Fa">int ioflag</var>,
<var class="Fa">struct ucred *cred</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">This VOP call zeroes/deallocates storage for an offset range in a
file. It is used to implement the <a class="Xr">fspacectl(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">offset</var></dt>
<dd>The start of the range to deallocate storage in the file.</dd>
<dt><var class="Fa">len</var></dt>
<dd>The length of the range to deallocate storage in the file.</dd>
<dt><var class="Fa">flags</var></dt>
<dd>The flags of this call. This should be set to 0 for now.</dd>
<dt><var class="Fa">ioflag</var></dt>
<dd>Directives and hints to be given to the file system.</dd>
<dt><var class="Fa">cred</var></dt>
<dd>The credentials of the caller.</dd>
</dl>
<p class="Pp"><var class="Fa">*offset</var> and <var class="Fa">*len</var> are
updated to reflect the portion of the range that still needs to be
zeroed/deallocated on return. Partial result is considered a successful
operation. For a non-partial successful completion,
<var class="Fa">*len</var> is updated to be the value 0, and
<var class="Fa">*offset</var> is incremented by the number of bytes zeroed
before the end-of-file.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="LOCKS"><a class="permalink" href="#LOCKS">LOCKS</a></h1>
<p class="Pp">The vnode should be locked on entry and will still be locked on
exit.</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>Invalid <var class="Fa">offset</var>, <var class="Fa">len</var> or
<var class="Fa">flags</var> parameters are passed into this VOP call.</dd>
<dt id="ENODEV">[<a class="permalink" href="#ENODEV"><code class="Er">ENODEV</code></a>]</dt>
<dd>The vnode type is not supported by this VOP call.</dd>
<dt id="ENOSPC">[<a class="permalink" href="#ENOSPC"><code class="Er">ENOSPC</code></a>]</dt>
<dd>The file system is full.</dd>
<dt id="EPERM">[<a class="permalink" href="#EPERM"><code class="Er">EPERM</code></a>]</dt>
<dd>An append-only flag is set on the file, but the caller is attempting to
zero before the current end of file.</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>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp"><code class="Nm">VOP_DEALLOCATE</code> and this manual page was
written by <span class="An">Ka Ho Ng</span>
<<a class="Mt" href="mailto:khng@FreeBSD.org">khng@FreeBSD.org</a>>
under sponsorship from the FreeBSD Foundation.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">August 25, 2021</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|