More locking clarifications. Add skeleton manual page for VOP_LEASE

This commit is contained in:
Matthew Dillon 1999-09-24 17:11:02 +00:00
parent 2b832347ec
commit 37af288330
4 changed files with 72 additions and 11 deletions

@ -5,7 +5,7 @@ MAN9= MD5.9 \
VFS_ROOT.9 VFS_START.9 VFS_STATFS.9 VFS_SYNC.9 VFS_UNMOUNT.9 \
VFS_VGET.9 VFS_VPTOFH.9 VFS_CHECKEXP.9 \
VOP_ABORTOP.9 VOP_ACCESS.9 VOP_ADVLOCK.9 VOP_ATTRIB.9 \
VOP_BWRITE.9 VOP_CREATE.9 VOP_FSYNC.9 \
VOP_BWRITE.9 VOP_CREATE.9 VOP_FSYNC.9 VOP_LEASE.9 \
VOP_GETPAGES.9 VOP_INACTIVE.9 VOP_IOCTL.9 VOP_LINK.9 \
VOP_LOCK.9 VOP_LOOKUP.9 VOP_MMAP.9 VOP_OPENCLOSE.9 \
VOP_PATHCONF.9 VOP_PRINT.9 VOP_RDWR.9 VOP_READDIR.9 \

@ -0,0 +1,57 @@
.\" -*- nroff -*-
.\"
.\" Copyright (c) 1996 Doug Rabson
.\"
.\" All rights reserved.
.\"
.\" This program is free software.
.\"
.\" 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 DEVELOPERS ``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 DEVELOPERS 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.
.\"
.\" $FreeBSD$
.\"
.Dd Sep 24, 1999
.Os
.Dt VOP_LEASE 9
.Sh NAME
.Nm VOP_LEASE
.Nd Validates a vnode for a particular set of credentials and operation type
.Sh SYNOPSIS
.Ft int
.Fn VOP_LEASE "struct vnode *vp" "struct proc *p" "struct ucred *cred" "int type"
.Sh DESCRIPTION
This entry point is currently not implemented. I believe the idea is to
validate a vnode for a particular set of user credentials and operation type.
The two operation types supported are LEASE_READ and LEASE_WRITE. The
function currently always returns 0.
.Pp
.Sh LOCKS
The vnode must be exclusively locked on entry, and should remain exclusively
locked on return.
.Sh RETURN VALUES
If successful, zero is returned. Otherwise, well... zero is returned too.
.Sh ERRORS
.Sh SEE ALSO
.Xr VOP_READ 9 ,
.Xr VOP_WRITE 9
.Sh AUTHORS
This man page was written by
.An Matt Dillon .

@ -60,9 +60,10 @@ The directory,
is locked on entry and should remain locked on return.
The file
.Fa vp
is not locked on entry and should be left unlocked on return.
If the VOP routine locks the file, it must remember to unlock it
prior to returning.
is not locked on entry and should remain that way on return.
If your VOP code locks
.Fa vp ,
it must be sure to unlock prior to returning.
.Sh RETURN VALUES
Zero is returned if the file was linked successfully, otherwise an
error is returned.
@ -126,7 +127,8 @@ out2:
the file is immutable
.El
.Sh SEE ALSO
.Xr vnode 9
.Xr vnode 9 ,
.Xr vn_lock 9
.Sh AUTHORS
This man page was written by
This man page was originally written by
.An Doug Rabson .

@ -59,11 +59,13 @@ the vnode of the target file (if it exists)
pathname information about the file's new name
.El
.Sh LOCKS
The source directory and file will have their ref count bumped on entry.
The destination directory and file will be locked and referenced on entry.
The procedure must release (not unlock) the source directory and file,
and must relase and unlock (i.e. vput) the destination directory and file
prior to return.
The source directory and file are unlocked but are expected to have their
ref count bumped on entry. The VOP routine is expected to vrele() both prior
to returning.
.Pp
The destination directory and file are locked as well as having their ref
count bumped. The VOP routine is expected to vput() both prior to
returning.
.Sh PSEUDOCODE
.Bd -literal
int