blob: ce6e0bd8c496d5b7d3d04fb4beb2e7a226d2773d (
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
|
<table class="head">
<tr>
<td class="head-ltitle">VOP_ALLOCATE(9)</td>
<td class="head-vol">Kernel Developer's Manual</td>
<td class="head-rtitle">VOP_ALLOCATE(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_ALLOCATE</code> —
<span class="Nd">allocate storage for 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_ALLOCATE</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 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 call allocates storage for a range of offsets in a file. It
is used to implement the <a class="Xr">posix_fallocate(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 allocate storage for in the file.</dd>
<dt><var class="Fa">len</var></dt>
<dd>The length of the range to allocate storage for in the file.</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">The <var class="Fa">offset</var> and <var class="Fa">len</var>
arguments are updated to reflect the portion of the range that still needs
to be allocated on return. A partial allocation is considered a successful
operation. The file's contents are not changed.</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 exclusively 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="EFBIG">[<a class="permalink" href="#EFBIG"><code class="Er">EFBIG</code></a>]</dt>
<dd>An attempt was made to write a file that exceeds the process's file size
limit or the maximum file size.</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
write 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>, <a class="Xr">VOP_READ(9)</a>,
<a class="Xr">VOP_WRITE(9)</a></p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">November 8, 2021</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|