diff options
-rw-r--r-- | share/man/man9/Makefile | 4 | ||||
-rw-r--r-- | share/man/man9/VOP_LOOKUP.9 | 98 |
2 files changed, 100 insertions, 2 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index bfd04f31013..3a9758c2b18 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.63 2003/03/08 23:17:18 jmc Exp $ +# $OpenBSD: Makefile,v 1.64 2003/03/10 20:20:29 tedu Exp $ # $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -17,7 +17,7 @@ MAN= altq.9 audio.9 autoconf.9 boot.9 bus_dma.9 bus_space.9 copy.9 \ style.9 \ time.9 timeout.9 tvtohz.9 uiomove.9 uvm.9 \ vaccess.9 vclean.9 vcount.9 vdevgone.9 vfinddev.9 vflush.9 vget.9 \ - vgone.9 vhold.9 vinvalbuf.9 vput.9 vref.9 vrele.9 \ + vgone.9 vhold.9 vinvalbuf.9 VOP_LOOKUP.9 vput.9 vref.9 vrele.9 \ vnode.9 vn_lock.9 vrecycle.9 vwaitforio.9 MLINKS+=autoconf.9 config_init.9 autoconf.9 config_search.9 \ diff --git a/share/man/man9/VOP_LOOKUP.9 b/share/man/man9/VOP_LOOKUP.9 new file mode 100644 index 00000000000..76d7d4d515d --- /dev/null +++ b/share/man/man9/VOP_LOOKUP.9 @@ -0,0 +1,98 @@ +.\" +.\" Copyright (c) 2003 Ted Unangst +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.Dd March 9, 2003 +.Dt VOP 9 +.Os +.Sh NAME +.Nm VOP functions +.Nd vnode operations +.Sh SYNOPSIS +.Fd #include <sys/vnode.h> +.Ft int +.Fo VOP_LOOKUP +.Fa "struct vnode *dvp" +.Fa "struct vnode **vpp" +.Fa "struct componentname *cnp" +.Fc +.\" and many more +.Sh DESCRIPTION +The +.Nm +functions implement a generic way to perform operations on vnodes. +The VOP function called passes the arguments to the correct file system +specific function. +Not all file systems implement all operations, in which case a generic +method will be used. +These functions exist to provide an abstract method to invoke vnode +operations without needing to know anything about the underlying file system. +.Pp +The arguments for each VOP +function consist of one or more vnode pointers along with other data +needed to perform the operation. +Care must be taken to obey the vnode locking discipline when using +VOP functions. +The locking discipline for all currently defined VOP +functions is described in the file +.Pa sys/kern/vnode_if.src . +.Sh VOP_LOOKUP +.Nm VOP_LOOKUP +finds the file corresponding to the name +.Ar cnp +in the directory +.Ar dvp +and returns a vnode in +.Ar vpp . +.Ar dvp +is locked on entry and exit, and +.Ar vpp +is locked upon a succesful return. +.Ar vpp +will be NULL on error, and cnp->cn_flags will be set to PDIRUNLOCK +if +.Ar dvp +has been unlocked for an unsuccessful return. +.Sh RETURN VALUES +The +.Nm +functions return 0 to indicate success and a non zero error code +to indicate failure. +.Sh FILES +.Bl -tag -width sys/kern/vnode_if.src +.It Pa sys/kern/vnode_if.src +source file containing +.Nm +definitions +.It Pa sys/kern/vnode_if.c +C file with implementations of each +.Nm +stub call +.El +.Sh SEE ALSO +.Xr errno 2 , +.Xr vn_lock 9 , +.Xr vnode 9 +.Sh BUGS +The locking discipline is too complex. Refer to +.Xr vn_lock 9 . |