xref: /netbsd-src/share/man/man9/vnodeops.9 (revision b1c86f5f087524e68db12794ee9c3e3da1ab17a0)
1.\"     $NetBSD: vnodeops.9,v 1.80 2010/06/24 13:03:06 hannken Exp $
2.\"
3.\" Copyright (c) 2001, 2005, 2006 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Gregory McGarry.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd June 24, 2010
31.Dt VNODEOPS 9
32.Os
33.Sh NAME
34.Nm vnodeops ,
35.Nm VOP_LOOKUP ,
36.Nm VOP_CREATE ,
37.Nm VOP_MKNOD ,
38.Nm VOP_OPEN ,
39.Nm VOP_CLOSE ,
40.Nm VOP_ACCESS ,
41.Nm VOP_GETATTR ,
42.Nm VOP_SETATTR ,
43.Nm VOP_READ ,
44.Nm VOP_WRITE ,
45.Nm VOP_IOCTL ,
46.Nm VOP_FCNTL ,
47.Nm VOP_POLL ,
48.Nm VOP_KQFILTER ,
49.Nm VOP_REVOKE ,
50.Nm VOP_MMAP ,
51.Nm VOP_FSYNC ,
52.Nm VOP_SEEK ,
53.Nm VOP_REMOVE ,
54.Nm VOP_LINK ,
55.Nm VOP_RENAME ,
56.Nm VOP_MKDIR ,
57.Nm VOP_RMDIR ,
58.Nm VOP_SYMLINK ,
59.Nm VOP_READDIR ,
60.Nm VOP_READLINK ,
61.Nm VOP_ABORTOP ,
62.Nm VOP_INACTIVE ,
63.Nm VOP_RECLAIM ,
64.Nm VOP_LOCK ,
65.Nm VOP_UNLOCK ,
66.Nm VOP_ISLOCKED ,
67.Nm VOP_BMAP ,
68.Nm VOP_PRINT ,
69.Nm VOP_PATHCONF ,
70.Nm VOP_ADVLOCK ,
71.Nm VOP_LEASE ,
72.Nm VOP_WHITEOUT ,
73.Nm VOP_GETPAGES ,
74.Nm VOP_PUTPAGES ,
75.Nm VOP_STRATEGY ,
76.Nm VOP_BWRITE ,
77.Nm VOP_GETEXTATTR ,
78.Nm VOP_SETEXTATTR ,
79.Nm VOP_LISTEXTATTR ,
80.Nm VOP_DELETEEXTATTR
81.Nd vnode operations
82.Sh SYNOPSIS
83.In sys/param.h
84.In sys/buf.h
85.In sys/dirent.h
86.In sys/lock.h
87.In sys/vnode.h
88.In sys/mount.h
89.In sys/namei.h
90.In sys/unistd.h
91.In sys/fcntl.h
92.In sys/lockf.h
93.In sys/extattr.h
94.Ft int
95.Fn VOP_LOOKUP "struct vnode *dvp" "struct vnode **vpp" \
96"struct componentname *cnp"
97.Ft int
98.Fn VOP_CREATE "struct vnode *dvp" "struct vnode **vpp" \
99"struct componentname *cnp" "struct vattr *vap"
100.Ft int
101.Fn VOP_MKNOD "struct vnode *dvp" "struct vnode **vpp" \
102"struct componentname *cnp" "struct vattr *vap"
103.Ft int
104.Fn VOP_OPEN "struct vnode *vp" "int mode" "kauth_cred_t cred"
105.Ft int
106.Fn VOP_CLOSE "struct vnode *vp" "int fflag" "kauth_cred_t cred"
107.Ft int
108.Fn VOP_ACCESS "struct vnode *vp" "int mode" "kauth_cred_t cred"
109.Ft int
110.Fn VOP_GETATTR "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred"
111.Ft int
112.Fn VOP_SETATTR "struct vnode *vp" "struct vattr *vap" "kauth_cred_t cred"
113.Ft int
114.Fn VOP_READ "struct vnode *vp" "struct uio *uio" "int ioflag" \
115"kauth_cred_t cred"
116.Ft int
117.Fn VOP_WRITE "struct vnode *vp" "struct uio *uio" "int ioflag" \
118"kauth_cred_t cred"
119.Ft int
120.Fn VOP_IOCTL "struct vnode *vp" "u_long command" "void *data" \
121"int fflag" "kauth_cred_t cred"
122.Ft int
123.Fn VOP_FCNTL "struct vnode *vp" "u_int command" "void *data" \
124"int fflag" "kauth_cred_t cred"
125.Ft int
126.Fn VOP_POLL "struct vnode *vp" "int events"
127.Ft int
128.Fn VOP_KQFILTER "struct vnode *vp" "struct knote *kn"
129.Ft int
130.Fn VOP_REVOKE "struct vnode *vp" "int flags"
131.Ft int
132.Fn VOP_MMAP "struct vnode *vp" "vm_prot_t prot" "kauth_cred_t cred"
133.Ft int
134.Fn VOP_FSYNC "struct vnode *vp" "kauth_cred_t cred" "int flags" \
135"off_t offlo" "off_t offhi"
136.Ft int
137.Fn VOP_SEEK "struct vnode *vp" "off_t oldoff" "off_t newoff" \
138"kauth_cred_t cred"
139.Ft int
140.Fn VOP_REMOVE "struct vnode *vp" "struct vnode *vp" \
141"struct componentname *cnp"
142.Ft int
143.Fn VOP_LINK "struct vnode *dvp" "struct vnode *vp" \
144"struct componentname *cnp"
145.Ft int
146.Fn VOP_RENAME "struct vnode *fdvp" "struct vnode *fvp" \
147"struct componentname *fcnp" "struct vnode *tdvp" \
148"struct vnode *tvp" "struct componentname *tcnp"
149.Ft int
150.Fn VOP_MKDIR "struct vnode *dvp" "struct vnode **vpp" \
151"struct componentname *cnp" "struct vattr *vap"
152.Ft int
153.Fn VOP_RMDIR "struct vnode *dvp" "struct vnode *vp" \
154"struct componentname *cnp"
155.Ft int
156.Fn VOP_SYMLINK "struct vnode *dvp" "struct vnode **vpp" \
157"struct componentname *cnp" "struct vattr *vap" "char *target"
158.Ft int
159.Fn VOP_READDIR "struct vnode *vp" "struct uio *uio" \
160"kauth_cred_t cred" "int *eofflag" "off_t **cookies" "int *ncookies"
161.Ft int
162.Fn VOP_READLINK "struct vnode *vp" "struct uio *uio" "kauth_cred_t cred"
163.Ft int
164.Fn VOP_ABORTOP "struct vnode *dvp" "struct componentname *cnp"
165.Ft int
166.Fn VOP_INACTIVE "struct vnode *vp"
167.Ft int
168.Fn VOP_RECLAIM "struct vnode *vp"
169.Ft int
170.Fn VOP_LOCK "struct vnode *vp" "int flags"
171.Ft int
172.Fn VOP_UNLOCK "struct vnode *vp"
173.Ft int
174.Fn VOP_ISLOCKED "struct vnode *vp"
175.Ft int
176.Fn VOP_BMAP "struct vnode *vp" "daddr_t bn" "struct vnode **vpp" \
177"daddr_t *bnp" "int *runp"
178.Ft int
179.Fn VOP_PRINT "struct vnode *vp"
180.Ft int
181.Fn VOP_PATHCONF "struct vnode *vp" "int name" "register_t *retval"
182.Ft int
183.Fn VOP_ADVLOCK "struct vnode *vp" "void *id" "int op" \
184"struct flock *fl" "int flags"
185.Ft int
186.Fn VOP_LEASE "struct vnode *vp" "kauth_cred_t cred" \
187"int flag"
188.Ft int
189.Fn VOP_WHITEOUT "struct vnode *dvp" "struct componentname *cnp" \
190"int flags"
191.Ft int
192.Fn VOP_GETPAGES "struct vnode *vp" "voff_t offset" "struct vm_page **m" \
193"int *count" "int centeridx" "vm_prot_t access_type" "int advice" "int flags"
194.Ft int
195.Fn VOP_PUTPAGES "struct vnode *vp" "voff_t offlo" "voff_t offhi" \
196"int flags"
197.Ft int
198.Fn VOP_STRATEGY "struct vnode *vp" "struct buf *bp"
199.Ft int
200.Fn VOP_BWRITE "struct buf *bp"
201.Ft int
202.Fn VOP_GETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" \
203"struct uio *uio" "size_t *size" "kauth_cred_t cred"
204.Ft int
205.Fn VOP_SETEXTATTR "struct vnode *vp" "int attrnamespace" "const char *name" \
206"struct uio *uio" "kauth_cred_t cred"
207.Ft int
208.Fn VOP_LISTEXTATTR "struct vnode *vp" "int attrnamespace" "struct uio *uio" \
209"size_t *size" "kauth_cred_t cred"
210.Ft int
211.Fn VOP_DELETEEXTATTR "struct vnode *vp" "int attrnamespace" \
212"const char *name" "kauth_cred_t cred"
213.Pp
214Not all header files are required for each function.
215.Sh DESCRIPTION
216The vnode operations vector describes what operations can be done to
217the file associated with the vnode.
218The system maintains one vnode operations vector for each file system
219type configured into the kernel.
220The vnode operations vector contains a pointer to a function for each
221operation supported by the file system.
222Many of the functions described in the vnode operations vector are
223closely related to their corresponding system calls.
224In most cases, they are called as a result of the system call
225associated with the operation being invoked.
226.Pp
227Functions in the vnode operations vector are invoked using specialized
228macros.
229The following table gives a summary of the operations.
230.Pp
231.Bl -column "VOP_DELETEEXTATTR" "Wake up process sleeping on lock" -compact
232.It Sy Macro Ta Sy Description
233.It VOP_LOOKUP	Lookup file name in name cache
234.It VOP_CREATE	Create a new file
235.It VOP_MKNOD	Make a new device
236.It VOP_OPEN	Open a file
237.It VOP_CLOSE	Close a file
238.It VOP_ACCESS	Determine file accessibility
239.It VOP_GETATTR	Get file attributes
240.It VOP_SETATTR	Set file attributes
241.It VOP_READ	Read from a file
242.It VOP_WRITE	Write to a file
243.It VOP_IOCTL	Perform device-specific I/O
244.It VOP_FCNTL	Perform file control
245.It VOP_POLL	Test if poll event has occurred
246.It VOP_KQFILTER	Register a knote
247.It VOP_REVOKE	Eliminate vode activity
248.It VOP_MMAP	Map file into user address space
249.It VOP_FSYNC	Flush pending data to disk
250.It VOP_SEEK	Test if file is seekable
251.It VOP_REMOVE	Remove a file
252.It VOP_LINK	Link a file
253.It VOP_RENAME	Rename a file
254.It VOP_MKDIR	Make a new directory
255.It VOP_RMDIR	Remove a directory
256.It VOP_SYMLINK	Create a symbolic link
257.It VOP_READDIR	Read directory entry
258.It VOP_READLINK	Read contents of a symlink
259.It VOP_ABORTOP	Abort pending operation
260.It VOP_INACTIVE	Release the inactive vnode
261.It VOP_RECLAIM	Reclaim vnode for another file
262.It VOP_LOCK	Sleep until vnode lock is free
263.It VOP_UNLOCK	Wake up process sleeping on lock
264.It VOP_ISLOCKED	Test if vnode is locked
265.It VOP_BMAP	Logical block number conversion
266.It VOP_PRINT	Print debugging information
267.It VOP_PATHCONF	Return POSIX pathconf data
268.It VOP_ADVLOCK	Advisory record locking
269.It VOP_LEASE	Validate vnode credentials
270.It VOP_WHITEOUT	Whiteout vnode
271.It VOP_GETPAGES	Read VM pages from file
272.It VOP_PUTPAGES	Write VM pages to file
273.It VOP_STRATEGY	Read/write a file system buffer
274.It VOP_BWRITE	Write a file system buffer
275.It VOP_GETEXTATTR	Get extended attribute
276.It VOP_SETEXTATTR	Set extended attribute
277.It VOP_LISTEXTATTR	List extended attributes
278.It VOP_DELETEEXTATTR	Remove extended attribute
279.El
280.Pp
281The implementation details of the vnode operations vector are not
282quite what is described here.
283.Pp
284If the file system type does not support a specific operation, it must
285nevertheless assign an appropriate function in the vnode operations
286vector to do the minimum required of it.
287In most cases, such functions either do nothing or return an error
288value to the effect that it is not supported.
289.Pp
290Many of the functions in the vnode operations vector take a
291componentname structure.
292It is used to encapsulate many parameters into a single function
293argument.
294It has the following structure:
295.Bd -literal
296struct componentname {
297        /*
298         * Arguments to lookup.
299         */
300        uint32_t cn_nameiop;    /* namei operation */
301        uint32_t cn_flags;      /* flags to namei */
302        kauth_cred_t cn_cred;   /* credentials */
303        /*
304         * Shared between lookup and commit routines.
305         */
306        char    *cn_pnbuf;      /* pathname buffer */
307        const char *cn_nameptr; /* pointer to looked up name */
308        size_t  cn_namelen;     /* length of looked up component */
309        u_long  cn_hash;        /* hash value of looked up name */
310        size_t  cn_consume;     /* chars to consume in lookup() */
311};
312.Ed
313.Pp
314The top half of the structure is used exclusively for the pathname
315lookups using
316.Fn VOP_LOOKUP
317and is initialized by the caller.
318The semantics of the lookup are affected by the lookup operation
319specified in
320.Em cn_nameiop
321and the flags specified in
322.Em cn_flags .
323Valid operations are:
324.Pp
325.Bl  -tag -offset indent -width LOOKUP -compact
326.It LOOKUP
327perform name lookup only
328.It CREATE
329set up for file creation
330.It DELETE
331set up for file deletion
332.It RENAME
333set up for file renaming
334.It OPMASK
335mask for operation
336.El
337.Pp
338Valid values for
339.Em cn-\*[Gt]cn_flags
340are:
341.Pp
342.Bl  -tag -offset indent -width LOCKPARENT -compact
343.It LOCKLEAF
344lock inode on return
345.It LOCKPARENT
346want parent vnode returned locked
347.It NOCACHE
348name must not be left in name cache (see
349.Xr namecache 9 )
350.It FOLLOW
351follow symbolic links
352.It NOFOLLOW
353do not follow symbolic links (pseudo)
354.It MODMASK
355mask of operational modifiers
356.El
357.Pp
358No vnode operations may be called from interrupt context.
359Most operations also require the vnode to be locked on entry.
360To prevent deadlocks, when acquiring locks on multiple vnodes, the
361lock of parent directory must be acquired before the lock on the child
362directory.
363.Pp
364Vnode operations for a file system type generally should not be
365called directly from the kernel, but accessed indirectly through the
366high-level convenience functions discussed in
367.Xr vnsubr 9 .
368.Sh FUNCTIONS
369.Bl -tag -width compact
370.It Fn VOP_LOOKUP "dvp" "vpp" "cnp"
371Lookup a single pathname component in a given directory.
372The argument
373.Fa dvp
374is the locked vnode of the directory to search and
375.Fa cnp
376is the pathname component to be searched for.
377If the pathname component is found, the address of the resulting
378locked vnode is returned in
379.Fa vpp .
380The operation specified in
381.Em cnp-\*[Gt]cn_nameiop
382gives
383.Fn VOP_LOOKUP
384hints about the reason for requesting the lookup and uses it to cache
385file system type specific information in the vnode for subsequent
386operations.
387.Pp
388There are three types of lookups: ".", ".." (ISDOTDOT), and other.
389If the pathname component being searched for is ".", then
390.Fa dvp
391has an extra reference added to it and it is returned in
392.Fa *vpp .
393If the pathname component being search for is ".." (ISDOTDOT),
394.Fa dvp
395is unlocked, the ".." node is locked and then
396.Fa dvp
397is relocked.
398This process preserves the protocol of always locking nodes from root
399downward and prevents deadlock.
400For other pathname components,
401.Fn VOP_LOOKUP
402checks the accessibility of the directory and searches the name cache
403for the pathname component.
404See
405.Xr namecache 9 .
406If the pathname is not found in the name cache, the directory is
407searched for the pathname.
408The resulting locked vnode is returned in
409.Fa vpp .
410.Fa dvp
411is always returned locked.
412.Pp
413On failure
414.Fa *vpp
415is
416.Dv NULL ,
417and
418.Fa *dvp
419is left locked.
420If the operation is successful
421.Fa *vpp
422is locked and zero is returned.
423Typically, if
424.Fa *vpp
425and
426.Fa dvp
427are the same vnode the caller will need to release twice (decrement
428the reference count) and unlock once.
429.It Fn VOP_CREATE "dvp" "vpp" "cnp" "vap"
430Create a new file in a given directory.
431The argument
432.Fa dvp
433is the locked vnode of the directory to create the new file in and
434.Fa cnp
435is the pathname component of the new file.
436The argument
437.Fa vap
438specifies the attributes that the new file should be created with.
439If the file is successfully created, the address of the resulting
440locked vnode is returned in
441.Fa vpp
442and zero is returned.
443Regardless of the return value, the directory vnode
444.Fa dvp
445will be unlocked on return.
446.Pp
447This function is called after
448.Fn VOP_LOOKUP
449when a file is being created.
450Normally,
451.Fn VOP_LOOKUP
452will have set the SAVENAME flag in
453.Em cnp-\*[Gt]cn_flags
454to keep the memory pointed to by
455.Em cnp-\*[Gt]cn_pnbuf
456valid.
457If an error is detected when creating the file, this memory is
458released.
459If the file is created successfully it will be released unless the
460SAVESTART flags in specified in
461.Em cnp-\*[Gt]cn_flags .
462.It Fn VOP_MKNOD "dvp" "vpp" "cnp" "vap"
463Make a new device-special file in a given directory.
464The argument
465.Fa dvp
466is the locked vnode of the directory to create the new device-special
467file in and
468.Fa cnp
469is the pathname component of the new device-special file.
470The argument
471.Fa vap
472specifies the attributes that the new device-special file should be
473created with.
474If the file is successfully created, the address of the resulting
475locked vnode is returned in
476.Fa vpp
477and zero is returned.
478.Pp
479This function is called after
480.Fn VOP_LOOKUP
481when a device-special file is being created.
482Normally,
483.Fn VOP_LOOKUP
484will have set the SAVENAME flag in
485.Em cnp-\*[Gt]cn_flags
486to keep the memory pointed to by
487.Em cnp-\*[Gt]cn_pnbuf
488valid.
489If an error is detected when creating the device-special file,
490this memory is released.
491If the device-special file is created successfully it will be released
492unless the SAVESTART flags in specified in
493.Em cnp-\*[Gt]cn_flags .
494.It Fn VOP_OPEN "vp" "mode" "cred"
495Open a file.
496The argument
497.Fa vp
498is the vnode of the file to open and
499.Fa mode
500specifies the access mode required by the calling process.
501The calling credentials are specified by
502.Fa cred .
503The access mode is a set of flags, including FREAD, FWRITE,
504O_NONBLOCK, O_APPEND, etc.
505.Fn VOP_OPEN
506must be called before a file can be accessed by a thread.
507The vnode reference count is incremented.
508.Pp
509.Fn VOP_OPEN
510expects the vnode
511.Fa vp
512to be locked on entry and will leave it locked on return.
513If the operation is successful zero is returned, otherwise an
514appropriate error code is returned.
515.It Fn VOP_CLOSE "vp" "fflag" "cred"
516Close a file.
517The argument
518.Fa vp
519is the vnode of the file to close and
520.Fa fflag
521specifies the access mode by the calling process.
522The possible flags are
523.Dv FREAD ,
524.Dv FWRITE
525and
526.Dv FNONBLOCK .
527The calling credentials are specified by
528.Fa cred .
529.Fn VOP_CLOSE
530frees resources allocated by
531.Fn VOP_OPEN .
532.Pp
533The vnode
534.Fa vp
535will be locked on entry and should remain locked on return.
536.It Fn VOP_ACCESS "vp" "mode" "cred"
537Determine the accessibility (permissions) of the file against the
538specified credentials.
539The argument
540.Fa vp
541is the vnode of the file to check,
542.Fa mode
543is the type of access required and
544.Fa cred
545contains the user credentials to check.
546The argument
547.Fa mode
548is a mask which can contain VREAD, VWRITE or VEXEC.
549If the file is accessible in the specified way, zero is returned,
550otherwise an appropriate error code is returned.
551.Pp
552The vnode
553.Fa vp
554will be locked on entry and should remain locked on return.
555.It Fn VOP_GETATTR "vp" "vap" "cred"
556Get specific vnode attributes on a file.
557The argument
558.Fa vp
559is the vnode of the file to get the attributes for.
560The argument
561.Fa cred
562specifies the calling credentials.
563.Fn VOP_GETATTR
564uses the file system type specific data object
565.Em vp-\*[Gt]v_data
566to reference the underlying file attributes.
567Attributes associated with the file are collected by setting the
568required attribute bits in
569.Em vap-\*[Gt]va_mask .
570The attributes are returned in
571.Fa vap .
572Attributes which are not available are set to the value VNOVAL.
573.Pp
574For more information on vnode attributes see
575.Xr vattr 9 .
576.It Fn VOP_SETATTR "vp" "vap" "cred"
577Set specific vnode attributes on a file.
578The argument
579.Fa vp
580is the locked vnode of the file to set the attributes for.
581The argument
582.Fa cred
583specifies the calling credentials.
584.Fn VOP_SETATTR
585uses the file system type specific data object
586.Em vp-\*[Gt]v_data
587to reference the underlying file attributes.
588The new attributes are defined in
589.Fa vap .
590Attributes associated with the file are set by setting the required
591attribute bits in
592.Em vap-\*[Gt]va_mask .
593Attributes which are not being modified by
594.Fn VOP_SETATTR
595should be set to the value VNOVAL.
596If the operation is successful zero is returned, otherwise an
597appropriate error is returned.
598.Pp
599For more information on vnode attributes see
600.Xr vattr 9 .
601.It Fn VOP_READ "vp" "uio" "ioflag" "cred"
602Read the contents of a file.
603The argument
604.Fa vp
605is the vnode of the file to read from,
606.Fa uio
607is the location to read the data into,
608.Fa ioflag
609is a set of flags and
610.Fa cred
611are the credentials of the calling process.
612.Pp
613The
614.Fa ioflag
615argument is used to give directives and hints to the file system.
616When attempting a read, the high 16 bits are used to provide a
617read-ahead hint (in unit of file system blocks) that the file system
618should attempt.
619The low 16 bits are a bit mask which can contain the following flags:
620.Pp
621.Bl -tag -offset indent -width IO_ALTSEMANTICS -compact
622.It IO_UNIT
623do I/O as atomic unit
624.It IO_APPEND
625append write to end
626.It IO_SYNC
627sync I/O file integrity completion
628.It IO_NODELOCKED
629underlying node already locked
630.It IO_NDELAY
631FNDELAY flag set in file table
632.It IO_DSYNC
633sync I/O data integrity completion
634.It IO_ALTSEMANTICS
635use alternate I/O semantics
636.It IO_NORMAL
637operate on regular data
638.It IO_EXT
639operate on extended attributes
640.It IO_DIRECT
641do not buffer data in the kernel
642.El
643.Pp
644Zero is returned on success, otherwise an error is returned.
645The vnode should be locked on entry and remains locked on exit.
646.It Fn VOP_WRITE "vp" "uio" "ioflag" "cred"
647Write to a file.
648The argument
649.Fa vp
650is the vnode of the file to write to,
651.Fa uio
652is the location of the data to write,
653.Fa ioflag
654is a set of flags and
655.Fa cred
656are the credentials of the calling process.
657.Pp
658The
659.Fa ioflag
660argument is used to give directives and hints to the file system.
661The low 16 bits are a bit mask which can contain the same flags as
662.Fn VOP_READ .
663.Pp
664Zero is returned on success, otherwise an error is returned.
665The vnode should be locked on entry and remains locked on exit.
666.It Fn VOP_IOCTL "vp" "command" "data" "fflag" "cred"
667Perform device-specific I/O.
668The argument
669.Fa vp
670is the locked vnode of the file, normally representing a device.
671The argument
672.Fa command
673specifies the device-specific operation to perform and
674.Fa cnp
675provides extra data for the specified operation.
676The argument
677.Fa fflags
678is a set of flags.
679The argument
680.Fa cred
681is the caller's credentials.
682If the operation is successful, zero is
683returned, otherwise an appropriate error code is returned.
684.Pp
685Most file systems do not supply a function for
686.Fn VOP_IOCTL .
687This function implements the
688.Xr ioctl 2
689system call.
690.It Fn VOP_FCNTL "vp" "command" "data" "fflag" "cred"
691Perform file control.
692The argument
693.Fa vp
694is the locked vnode of the file.
695The argument
696.Fa command
697specifies the operation to perform and
698.Fa cnp
699provides extra data for the specified operation.
700The argument
701.Fa fflags
702is a set of flags.
703The argument
704.Fa cred
705is the caller's credentials.
706If the operation is successful, zero is returned, otherwise an
707appropriate error code is returned.
708.It Fn VOP_POLL "vp" "events"
709Test if a poll event has occurred.
710The argument
711.Fa vp
712is the vnode of the file to poll.
713It returns any events of interest as specified by
714.Fa events
715that may have occurred for the file.
716The argument
717.Fa events
718is a set of flags as specified by
719.Xr poll 2 .
720.It Fn VOP_KQFILTER "vp" "kn"
721Register a knote
722.Fa kn
723with the vnode
724.Fa vn .
725If the operation is successful zero is returned, otherwise an
726appropriate error code is returned.
727.It Fn VOP_REVOKE "vp" "flags"
728Eliminate all activity associated with the vnode
729.Fa vp .
730The argument
731.Fa flags
732is a set of flags.
733If REVOKEALL is set in
734.Fa flags
735all vnodes aliased to the vnode
736.Fa vp
737are also eliminated.
738If the operation is successful zero is returned, otherwise an
739appropriate error is returned.
740.It Fn VOP_MMAP "vp" "prot" "cred"
741Inform file system that
742.Fa vp
743is in the process of being memory mapped.
744The argument
745.Fa prot
746specifies the vm access protection the vnode is going to be mapped with.
747The argument
748.Fa cred
749is the caller's credentials.
750If the file system allows the memory mapping, zero is returned, otherwise
751an appropriate error code is returned.
752.Pp
753Most file systems do not supply a function for
754.Fn VOP_MMAP
755and use
756.Fn genfs_mmap
757to default for success.
758Only file systems which do not integrate with the page cache at all
759typically want to disallow memory mapping.
760.It Fn VOP_FSYNC "vp" "cred" "flags" "offlo" "offhi"
761Flush pending data buffers for a file to disk.
762The argument
763.Fa vp
764is the locked vnode of the file for flush.
765The argument
766.Fa cred
767is the caller's credentials.
768The argument
769.Fa flags
770is a set of flags.
771If FSYNC_WAIT is specified in
772.Fa flags ,
773the function should wait for I/O to complete before returning.
774The argument
775.Fa offlo
776and
777.Fa offhi
778specify the range of file to flush.
779If the operation is successful zero is returned, otherwise an
780appropriate error code is returned.
781.Pp
782This function implements the
783.Xr sync 2
784and
785.Xr fsync 2
786system calls.
787.It Fn VOP_SEEK "vp" "oldoff" "newoff" "cred"
788Test if the file is seekable for the specified offset
789.Fa newoff .
790The argument
791.Fa vp
792is the locked vnode of the file to test.
793For most file systems this function simply tests if
794.Fa newoff
795is valid.
796If the specified
797.Fa newoff
798is less than zero, the function returns error code EINVAL.
799.It Fn VOP_REMOVE "dvp" "vp" "cnp"
800Remove a file.
801The argument
802.Fa dvp
803is the locked vnode of the directory to remove the file from and
804.Fa vp
805is the locked vnode of the file to remove.
806The argument
807.Fa cnp
808is the pathname component about the file to remove.
809If the operation is successful zero is returned, otherwise an
810appropriate error code is returned.
811Both
812.Fa dvp
813and
814.Fa vp
815are locked on entry and are to be unlocked before returning.
816.It Fn VOP_LINK "dvp" "vp" "cnp"
817Link to a file.
818The argument
819.Fa dvp
820is the locked node of the directory to create the new link and
821.Fa vp
822is the vnode of the file to be linked.
823The argument
824.Fa cnp
825is the pathname component of the new link.
826If the operation is successful zero is returned, otherwise an error
827code is returned.
828The directory vnode
829.Fa dvp
830should be locked on entry and will be released and unlocked on return.
831The vnode
832.Fa vp
833should not be locked on entry and will remain unlocked on return.
834.It Fn VOP_RENAME "fdvp" "fvp" "fcnp" "tdvp" "tvp" "tcnp"
835Rename a file.
836The argument
837.Fa fdvp
838is the vnode of the old parent directory containing in the file to be
839renamed and
840.Fa fvp
841is the vnode of the file to be renamed.
842The argument
843.Fa fcnp
844is the pathname component about the file to be renamed.
845The argument
846.Fa tdvp
847is the vnode of the new directory of the target file and
848.Fa tvp
849is the vnode of the target file (if it exists).
850The argument
851.Fa tcnp
852is the pathname component about the file's new name.
853If the operation is successful zero is returned, otherwise and error
854code is returned.
855.Pp
856The source directory and file vnodes should be unlocked and their
857reference counts should be incremented before entry.
858The target directory and file vnodes should both be locked on entry.
859.Fn VOP_RENAME
860updates the reference counts prior to returning.
861.It Fn VOP_MKDIR "dvp" "vpp" "cnp" "vap"
862Make a new directory in a given directory.
863The argument
864.Fa dvp
865is the locked vnode of the directory to create the new directory in and
866.Fa cnp
867is the pathname component of the new directory.
868The argument
869.Fa vap
870specifies the attributes that the new directory should be created
871with.
872If the file is successfully created, the address of the resulting
873locked vnode is returned in
874.Fa vpp
875and zero is returned.
876.Pp
877This function is called after
878.Fn VOP_LOOKUP
879when a directory is being created.
880Normally,
881.Fn VOP_LOOKUP
882will have set the SAVENAME flag in
883.Em cnp-\*[Gt]cn_flags
884to keep the memory pointed to by
885.Em cnp-\*[Gt]cn_pnbuf
886valid.
887If an error is detected when creating the directory, this memory is
888released.
889If the directory is created successfully it will be released unless
890the SAVESTART flags in specified in
891.Em cnp-\*[Gt]cn_flags .
892.It Fn VOP_RMDIR "dvp" "vp" "cnp"
893Remove a directory in a given directory.
894The argument
895.Fa dvp
896is the locked vnode of the directory to remove the directory from and
897.Fa vp
898is the locked vnode of the directory to remove.
899The argument
900.Fa cnp
901is the pathname component of the directory.
902Zero is returned on success, otherwise an error code is returned.
903Both
904.Fa dvp
905and
906.Fa vp
907should be locked on entry and will be released and unlocked on return.
908.It Fn VOP_SYMLINK "dvp" "vpp" "cnp" "vap" "target"
909Create a symbolic link in a given directory.
910The argument
911.Fa dvp
912is the locked vnode of the directory to create the symbolic link in
913and
914.Fa cnp
915is the pathname component of the symbolic link.
916The argument
917.Fa vap
918specifies the attributes that the symbolic link should be created
919with and
920.Fa target
921specifies the pathname of the target of the symbolic link.
922If the symbolic link is successfully created, the address of the
923resulting locked vnode is returned in
924.Fa vpp
925and zero is returned.
926.Pp
927This function is called after
928.Fn VOP_LOOKUP
929when a symbolic link is being created.
930Normally,
931.Fn VOP_LOOKUP
932will have set the SAVENAME flag in
933.Em cnp-\*[Gt]cn_flags
934to keep the memory pointed to by
935.Em cnp-\*[Gt]cn_pnbuf
936valid.
937If an error is detected when creating the symbolic link, this memory
938is released.
939If the symbolic link is created successfully it will be released
940unless the SAVESTART flags in specified in
941.Em cnp-\*[Gt]cn_flags .
942.It Fn VOP_READDIR "vp" "uio" "cred" "eofflag" "cookies" "ncookies"
943Read directory entry.
944The argument
945.Fa vp
946is the vnode of the directory to read the contents of and
947.Fa uio
948is the destination location to read the contents into.
949The argument
950.Fa cred
951is the caller's credentials.
952The argument
953.Fa eofflag
954is the pointer to a flag which is set by
955.Fn VOP_READDIR
956to indicate an end-of-file condition.
957If
958.Fa eofflag
959is
960.Dv NULL ,
961the end-of-file condition is not returned.
962The arguments
963.Fa cookies
964and
965.Fa ncookies
966specify the addresses for the list and number of directory seek
967cookies generated for NFS.
968Both
969.Fa cookies
970and
971.Fa ncookies
972should be
973.Dv NULL
974if they aren't required to be returned by
975.Fn VOP_READDIR .
976The directory contents are read into struct dirent structures and
977.Fa uio-\*[Gt]uio_offset
978is set to the offset of the next unread directory entry.
979This offset may be used in a following invocation to continue a
980sequential read of the directory contents.
981If the operation is successful zero is returned, otherwise an
982appropriate error code is returned.
983.Pp
984The directory should be locked on entry and will remain locked on
985return.
986.Pp
987In case
988.Fa ncookies
989and
990.Fa cookies
991are supplied, one cookie should be returned per directory entry.
992The value of the cookie for each directory entry should be the offset
993within the directory where the on-disk version of the following
994directory entry starts.
995That is, for each directory entry
996.Fa i ,
997the corresponding cookie should refer to the offset of directory entry
998.Fa i + 1 .
999.Pp
1000Note that the
1001.Fa cookies
1002array must be allocated by the callee using the M_TEMP malloc type as
1003callers of
1004.Fn VOP_READDIR
1005must be able to free the allocation.
1006.It Fn VOP_READLINK "vp" "uio" "cred"
1007Read the contents of a symbolic link.
1008The argument
1009.Fa vp
1010is the locked vnode of the symlink and
1011.Fa uio
1012is the destination location to read the contents into.
1013The argument
1014.Fa cred
1015is the credentials of the caller.
1016If the operation is successful zero is returned, otherwise an error
1017code is returned.
1018.Pp
1019The vnode should be locked on entry and will remain locked on return.
1020.It Fn VOP_ABORTOP "dvp" "cnp"
1021Abort pending operation on vnode
1022.Fa dvp
1023and free resources allocated in
1024.Fa cnp .
1025.Pp
1026This operation is rarely implemented in file systems and
1027.Fn genfs_abortop
1028is typically used instead.
1029.It Fn VOP_INACTIVE "vp"
1030Release the inactive vnode.
1031.Fn VOP_INACTIVE
1032is called when the kernel is no longer using the vnode.
1033This may be because the reference count reaches zero or it may be that
1034the file system is being forcibly unmounted while there are open
1035files.
1036It can be used to reclaim space for open but deleted files.
1037The argument
1038.Fa vp
1039is the locked vnode to be released.
1040If the operation is successful zero is returned, otherwise an
1041appropriate error code is returned.
1042The vnode
1043.Fa vp
1044must be locked on entry, and will be unlocked on return.
1045.It Fn VOP_RECLAIM "vp"
1046Reclaim the vnode for another file system.
1047.Fn VOP_RECLAIM
1048is called when a vnode is being reused for a different file system.
1049Any file system specific resources associated with the vnode should be
1050freed.
1051The argument
1052.Fa vp
1053is the vnode to be reclaimed.
1054If the operation is successful zero is returned, otherwise an
1055appropriate error code is returned.
1056The vnode
1057.Fa vp
1058should not be locked on entry, and will remain unlocked on return.
1059.It Fn VOP_LOCK "vp" "flags"
1060Sleep until vnode lock is free.
1061The argument
1062.Fa vp
1063is the vnode of the file to be locked.
1064The argument
1065.Fa flags
1066is
1067.Dv LK_EXCLUSIVE
1068to take the lock exclusively or
1069.Dv LK_SHARED
1070to take a shared lock.
1071If
1072.Fa flags
1073contains
1074.Dv LK_NOWAIT
1075and the lock is busy, the operation will return immediately with an error code.
1076If the operation is successful zero is returned, otherwise an
1077appropriate error code is returned.
1078.Fn VOP_LOCK
1079is used to serialize access to the file system such as to prevent two
1080writes to the same file from happening at the same time.
1081Kernel code should use
1082.Xr vn_lock 9
1083to lock a vnode rather than calling
1084.Fn VOP_LOCK
1085directly.
1086.It Fn VOP_UNLOCK "vp"
1087Wake up process sleeping on lock.
1088The argument
1089.Fa vp
1090is the vnode of the file to be unlocked.
1091If the operation is successful zero is returned, otherwise an
1092appropriate error code is returned.
1093.Fn VOP_UNLOCK
1094is used to serialize access to the file system such as to prevent two
1095writes to the same file from happening at the same time.
1096.It Fn VOP_ISLOCKED "vp"
1097Test if the vnode
1098.Fa vp
1099is locked.
1100Possible return values are
1101.Dv LK_EXCLUSIVE ,
1102.Dv LK_SHARED
1103or 0 for lock held exclusively by the calling thread, shared lock held
1104by anyone or unlocked, respectively.
1105.Pp
1106This function must never be used to make locking decisions at run time:
1107it is provided only for diagnostic purposes.
1108.It Fn VOP_BMAP "vp" "bn" "vpp" "bnp" "runp"
1109Convert the logical block number
1110.Fa bn
1111of a file specified by vnode
1112.Fa vp
1113to its physical block number on the disk.
1114The physical block is returned in
1115.Fa bnp .
1116In case the logical block is not allocated, \-1 is used.
1117.Pp
1118If
1119.Fa vpp
1120is not
1121.Dv NULL ,
1122the vnode of the device vnode for the file system is
1123returned in the address specified by
1124.Fa vpp .
1125If
1126.Fa runp
1127is not
1128.Dv NULL ,
1129the number of contiguous blocks starting from the next block after
1130the queried block will be returned in
1131.Fa runp .
1132.It Fn VOP_PRINT "vp"
1133Print debugging information.
1134The argument
1135.Fa vp
1136is the vnode to print.
1137If the operation is successful zero is returned, otherwise an
1138appropriate error code is returned.
1139.It Fn VOP_PATHCONF "vp" "name" "retval"
1140Implement POSIX
1141.Xr pathconf 2
1142and
1143.Xr fpathconf 2
1144support.
1145The argument
1146.Fa vp
1147is the locked vnode to get information about.
1148The argument
1149.Fa name
1150specified the type of information to return.
1151The information is returned in the address specified by
1152.Fa retval .
1153Valid values for
1154.Fa name
1155are:
1156.Pp
1157.Bl -tag -offset indent -width _PC_CHOWN_RESTRICTED -compact
1158.It _PC_LINK_MAX
1159return the maximum number of links to a file
1160.It _PC_NAME_MAX
1161return the maximum number of bytes in a file name
1162.It _PC_PATH_MAX
1163return the maximum number of bytes in a pathname
1164.It _PC_PIPE_BUF
1165return the maximum number of bytes which will be written atomically to
1166a pipe
1167.It _PC_CHOWN_RESTRICTED
1168return 1 if appropriate privileges are required for the
1169.Xr chown 2
1170system call, otherwise zero
1171.It _PC_NO_TRUNC
1172return if file names longer than KERN_NAME_MAX are truncated
1173.El
1174.Pp
1175If
1176.Fa name
1177is recognized,
1178.Fa *retval
1179is set to the specified value and zero is returned, otherwise an
1180appropriate error is returned.
1181.It Fn VOP_ADVLOCK "vp" "id" "op" "fl" "flags"
1182Manipulate Advisory record locks on a vnode.
1183The argument
1184.Fa vp
1185is the vnode on which locks are manipulated.
1186The argument
1187.Fa id
1188is the id token which is changing the lock and
1189.Fa op
1190is the
1191.Xr fcntl 2
1192operation to perform.
1193Valid values are:
1194.Pp
1195.Bl -tag -offset indent -width F_UNLCK -compact
1196.It F_SETLK
1197set lock
1198.It F_GETLK
1199get the first conflicted lock
1200.It F_UNLCK
1201clear lock
1202.El
1203.Pp
1204The argument
1205.Fa fl
1206is a description of the lock.
1207In the case of
1208.Dv SEEK_CUR ,
1209The caller should add the current file offset to
1210fl-\*[Gt]l_start beforehand.
1211.Fn VOP_ADVLOCK
1212treats
1213.Dv SEEK_CUR
1214as
1215.Dv SEEK_SET .
1216.Pp
1217The argument
1218.Fa flags
1219is the set of flags.
1220Valid values are:
1221.Pp
1222.Bl -tag -offset indent -width F_FLOCK -compact
1223.It F_WAIT
1224wait until lock is granted
1225.It F_FLOCK
1226use
1227.Xr flock 2
1228semantics for lock
1229.It F_POSIX
1230use POSIX semantics for lock
1231.El
1232.Pp
1233If the operation is successful zero is returned, otherwise an
1234appropriate error is returned.
1235.It Fn VOP_LEASE "vp" "cred" "flags"
1236Validate vnode credentials and operation type.
1237The argument
1238.Fa vp
1239is the locked vnode of the file to validate credentials
1240.Fa cred .
1241The argument
1242.Fa flags
1243specifies the operation flags.
1244If the operation is successful zero is returned, otherwise an
1245appropriate error code is returned.
1246The vnode must be locked on entry and remains locked on return.
1247.It Fn VOP_WHITEOUT "dvp" "cnp" "flags"
1248Whiteout pathname component in directory with vnode
1249.Fa dvp .
1250The argument
1251.Fa cnp
1252specifies the pathname component to whiteout.
1253.It Fn VOP_GETPAGES "vp" "offset" "m" "count" "centeridx" "access_type" "advice" "flags"
1254Read VM pages from file.
1255The argument
1256.Fa vp
1257is the locked vnode to read the VM pages from.
1258The argument
1259.Fa offset
1260is offset in the file to start accessing and
1261.Fa m
1262is an array of VM pages.
1263The argument
1264.Fa count
1265points a variable that specifies the number of pages to read.
1266If the operation is successful zero is returned, otherwise an
1267appropriate error code is returned.
1268If PGO_LOCKED is specified in
1269.Em flags ,
1270.Fn VOP_GETPAGES
1271might return less pages than requested.
1272In that case, the variable pointed to by
1273.Em count
1274will be updated.
1275.Pp
1276This function is primarily used by the page-fault handing mechanism.
1277.It Fn VOP_PUTPAGES "vp" "offlo" "offhi" "flags"
1278Write modified (dirty) VM pages to file.
1279The argument
1280.Fa vp
1281is the vnode to write the VM pages to.
1282The vnode's vm object lock
1283.Va ( v_uobj.vmobjlock )
1284must be held by the caller and will be released upon return.
1285The arguments
1286.Fa offlo
1287and
1288.Fa offhi
1289specify the range of VM pages to write.
1290In case
1291.Fa offhi
1292is given as 0, all pages at and after the start offset
1293.Fa offlo
1294belonging the vnode
1295.Fa vp
1296will be written.
1297The argument
1298.Fa flags
1299controls the behavior of the routine and takes the vm pager's
1300flags
1301.Dv ( PGO_ -prefixed ) .
1302If the operation is successful zero is returned, otherwise an
1303appropriate error code is returned.
1304.Pp
1305The function is primarily used by the pageout handling mechanism and
1306is commonly implemented indirectly
1307by
1308.Fn genfs_putpages
1309with the help of
1310.Fn VOP_STRATEGY
1311and
1312.Fn VOP_BMAP .
1313.It Fn VOP_STRATEGY "vp" "bp"
1314Read/write a file system buffer.
1315The argument
1316.Fa vp
1317is the vnode to read/write to.
1318The argument
1319.Fa bp
1320is the buffer to be read or written.
1321.Fn VOP_STRATEGY
1322will either read or write data to the file depending on the value of
1323.Em bp-\*[Gt]b_flags .
1324If the operation is successful zero is returned, otherwise an
1325appropriate error code is returned.
1326.It Fn VOP_BWRITE "bp"
1327Write a file system buffer.
1328The argument
1329.Fa bp
1330specifies the buffer to be written.
1331If the operation is successful zero is returned, otherwise an
1332appropriate error code is returned.
1333.It Fn VOP_GETEXTATTR "vp" "attrnamespace" "name" "uio" "size" "cred"
1334Get an extended attribute.
1335The argument
1336.Fa vp
1337is the locked vnode of the file or directory from which to retrieve the
1338attribute.
1339The argument
1340.Fa attrnamespace
1341specifies the extended attribute namespace.
1342The argument
1343.Fa name
1344is a nul-terminated character string naming the attribute to retrieve.
1345The argument
1346.Fa uio ,
1347if not
1348.Dv NULL ,
1349specifies where the extended attribute value is to be written.
1350The argument
1351.Fa size ,
1352if not
1353.Dv NULL ,
1354will contain the number of bytes required to read all of
1355the attribute data upon return.
1356In most cases,
1357.Fa uio
1358will be
1359.Dv NULL
1360when
1361.Fa size
1362is not, and vice versa.
1363The argument
1364.Fa cred
1365specifies the user credentials to use when authorizing the request.
1366.It Fn VOP_SETEXTATTR "vp" "attrnamespace" "name" "uio" "cred"
1367Set an extended attribute.
1368The argument
1369.Fa vp
1370is the locked vnode of the file or directory to which to store the
1371attribute.
1372The argument
1373.Fa namespace
1374specifies the extended attribute namespace.
1375The argument
1376.Fa name
1377is a nul-terminated character string naming the attribute to store.
1378The argument
1379.Fa uio
1380specifies the source of the extended attribute data.
1381The argument
1382.Fa cred
1383specifies the user credentials to use when authorizing the request.
1384.It Fn VOP_LISTEXTATTR "vp" "attrnamespace" "uio" "size" "cred"
1385Retrieve the list of extended attributes.
1386The argument
1387.Fa vp
1388is the locked vnode of the file or directory whose attributes are to be listed.
1389The argument
1390.Fa attrnamespace
1391specifies the extended attribute namespace.
1392The argument
1393.Fa uio ,
1394if not
1395.Dv NULL ,
1396specifies where the extended attribute list is to be written.
1397The argument
1398.Fa size ,
1399if not
1400.Dv NULL ,
1401will contain the number of bytes required to read all of
1402the attribute names upon return.
1403In most cases,
1404.Fa uio
1405will be
1406.Dv NULL
1407when
1408.Fa size
1409is not, and vice versa.
1410The argument
1411.Fa cred
1412specifies the user credentials to use when authorizing the request.
1413.It Fn VOP_DELETEEXTATTR "vp" "attrnamespace" "name" "cred"
1414Remove attribute
1415.Fa name
1416from file associated with
1417.Fa vp .
1418The argument
1419.Fa attrnamespace
1420specifies the extended attribute namespace.
1421If full removal is not supported, the file system should return
1422.Er EOPNOTSUPP
1423to allow the caller to zero out the value with
1424.Fn VOP_SETEXTATTR .
1425.El
1426.Sh ERRORS
1427.Bl -tag -width Er
1428.It Bq Er EACCES
1429Access for the specified operation is denied.
1430.It Bq Er EDQUOT
1431Quota exceeded.
1432.It Bq Er EINVAL
1433attempt to read from an illegal offset in the directory; unrecognized
1434input
1435.It Bq Er EIO
1436a read error occurred while reading the directory or reading the
1437contents of a symbolic link
1438.It Bq Er EJUSTRETURN
1439A CREATE or RENAME operation would be successful.
1440.It Bq Er ENOATTR
1441The requested attribute is not defined for this vnode.
1442.It Bq Er ENOENT
1443The component was not found in the directory.
1444.It Bq Er ENOSPC
1445The file system is full.
1446.It Bq Er ENOTDIR
1447The vnode does not represent a directory.
1448.It Bq Er ENOTEMPTY
1449attempt to remove a directory which is not empty
1450.It Bq Er EPERM
1451an attempt was made to change an immutable file
1452.It Bq Er EROFS
1453the file system is read-only
1454.El
1455.Sh SEE ALSO
1456.Xr extattr 9 ,
1457.Xr intro 9 ,
1458.Xr lock 9 ,
1459.Xr namei 9 ,
1460.Xr vattr 9 ,
1461.Xr vfs 9 ,
1462.Xr vfsops 9 ,
1463.Xr vnode 9
1464.Sh HISTORY
1465The vnode operations vector, its functions and the corresponding
1466macros appeared in
1467.Bx 4.3 .
1468