summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-13 07:56:49 +0000
committerdillon <dillon@FreeBSD.org>1999-02-13 07:56:49 +0000
commitd443f239dea6924499cf2f4daab65522c2057996 (patch)
tree97f3f7f5d96c9ab7345b533adc2c399c9f9307cb
parentf4351f3b6fd58eb5bdcecd7b3dbaa14ed1bb0637 (diff)
downloadFreeBSD-src-d443f239dea6924499cf2f4daab65522c2057996.zip
FreeBSD-src-d443f239dea6924499cf2f4daab65522c2057996.tar.gz
Clarify more of what VOP_LINK expects.
-rw-r--r--share/man/man9/VOP_LINK.915
1 files changed, 10 insertions, 5 deletions
diff --git a/share/man/man9/VOP_LINK.9 b/share/man/man9/VOP_LINK.9
index 9d668d5..f7147b2 100644
--- a/share/man/man9/VOP_LINK.9
+++ b/share/man/man9/VOP_LINK.9
@@ -26,7 +26,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: VOP_LINK.9,v 1.4 1998/03/12 07:31:11 charnier Exp $
+.\" $Id: VOP_LINK.9,v 1.5 1999/02/13 07:44:14 dillon Exp $
.\"
.Dd July 24, 1996
.Os
@@ -57,11 +57,13 @@ file vnodes should NOT be released on exit.
.Sh LOCKS
The directory,
.Fa dvp
-should be locked on entry. The caller will unlock and release
-it on return so the VOP routine should not.
+is locked on entry. The caller will unlock and release the directory
+on return. The VOP routine should not try to unlock or release
+the directory.
The file
.Fa vp
-should not be locked.
+is not locked on entry. If the VOP routine locks it, it must remember
+to unlock it prior to returning.
.Sh RETURN VALUES
Zero is returned if the file was linked successfully, otherwise an
error is returned.
@@ -82,6 +84,10 @@ vop_link(struct vnode *dvp, struct vnode *vp, struct componentname *cnp)
goto out2;
}
+ /*
+ * now that we've locked vp, we have to use out1 instead of out2
+ */
+
if (vp would have too many links) {
VOP_ABORTOP(dvp, cnp);
error = EMLINK;
@@ -111,7 +117,6 @@ out1:
if (vp != dvp)
VOP_UNLOCK(vp);
out2:
- vput(dvp);
return error;
}
OpenPOWER on IntegriCloud