From bebac989cc81365bfdfb0491926d4776bd452866 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 24 Sep 1999 10:42:45 +0000 Subject: [PATCH] More clarification of locking requirements. --- share/man/man9/VOP_ATTRIB.9 | 8 +++++++- share/man/man9/VOP_OPENCLOSE.9 | 16 +++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/share/man/man9/VOP_ATTRIB.9 b/share/man/man9/VOP_ATTRIB.9 index 4d2681435b2..5c0f35587fe 100644 --- a/share/man/man9/VOP_ATTRIB.9 +++ b/share/man/man9/VOP_ATTRIB.9 @@ -64,7 +64,13 @@ Attributes which are not being modified by should be set to the value .Dv VNOVAL . .Sh LOCKS -The file will not be locked on entry and should not be locked on return. +.Xr VOP_GETATTR 9 +expects the vnode to be locked on entry and will leave the vnode locked on +return. +.Pp +.Xr VOP_SETATTR 9 +expects the vnode to be locked on entry and will leave the vnode locked on +return. .Sh RETURN VALUES .Xr VOP_GETATTR 9 returns information about the file in diff --git a/share/man/man9/VOP_OPENCLOSE.9 b/share/man/man9/VOP_OPENCLOSE.9 index 8c0a0f6f24c..00d308c61a0 100644 --- a/share/man/man9/VOP_OPENCLOSE.9 +++ b/share/man/man9/VOP_OPENCLOSE.9 @@ -65,12 +65,18 @@ The access mode is a set of flags, including .Dv O_NONBLOCK , .Dv O_APPEND . .Sh LOCKS -The vnode -.Fa vp -should be locked on entry and will still be locked on exit for .Xr VOP_OPEN 9 -and unlocked on entry and exit for -.Xr VOP_CLOSE 9 . +expects +.Fa vp +to be locked on entry and will leave it locked on return. +.Pp +.Xr VOP_CLOSE 9 +expects at least a reference to be associated with the vnode and does not +care whether the vnode is locked or not. The lock and reference state is +left unchanged on return. Note that +.Fa vn_close +expects an unlocked, referenced vnode and will dereference the vnode prior +to returning. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh PSEUDOCODE