More clarification of locking requirements.

This commit is contained in:
Matthew Dillon 1999-09-24 10:42:45 +00:00
parent 065aee8253
commit bebac989cc
2 changed files with 18 additions and 6 deletions

View file

@ -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

View file

@ -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