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