From fe11eb74af3d5aef6ae4ba8e61c46ca7d5ede5b5 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Fri, 24 Sep 1999 07:07:02 +0000 Subject: [PATCH] Update errors in documentation for various VOP_ calls. Specifically, describe the correct locking state expected on entry and return. --- share/man/man9/VOP_ABORTOP.9 | 3 +++ share/man/man9/VOP_CREATE.9 | 2 +- share/man/man9/VOP_INACTIVE.9 | 9 +++++++++ share/man/man9/VOP_LINK.9 | 9 ++++----- share/man/man9/VOP_REMOVE.9 | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/share/man/man9/VOP_ABORTOP.9 b/share/man/man9/VOP_ABORTOP.9 index 4cfe66f4015..6f9171b550f 100644 --- a/share/man/man9/VOP_ABORTOP.9 +++ b/share/man/man9/VOP_ABORTOP.9 @@ -66,6 +66,9 @@ vop_abortop(struct vnode *dvp, struct componentname *cnp) return 0; } .Ed +.Sh LOCKS +.Fa dvp +should be locked on entry and remain locked on return. .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS diff --git a/share/man/man9/VOP_CREATE.9 b/share/man/man9/VOP_CREATE.9 index ddffbe197a2..cbf8949cafc 100644 --- a/share/man/man9/VOP_CREATE.9 +++ b/share/man/man9/VOP_CREATE.9 @@ -88,7 +88,7 @@ flag is specified in .Sh LOCKS The directory, .Fa dvp -should be locked on entry and will be unlocked and released on exit. +will be locked on entry and must remain locked on return. If the call is successful, the new object will be returned locked, unless the call is .Xr VOP_MKNOD 9 diff --git a/share/man/man9/VOP_INACTIVE.9 b/share/man/man9/VOP_INACTIVE.9 index 95d21db33d3..e9546ef2ff8 100644 --- a/share/man/man9/VOP_INACTIVE.9 +++ b/share/man/man9/VOP_INACTIVE.9 @@ -59,6 +59,14 @@ It can be used to reclaim space for 'open but deleted' files. is called when a vnode is being reused for a different filesystem. Any filesystem specific resources associated with the vnode should be freed. +.Sh LOCKS +.Pp +For VOP_INACTIVE, the vp will be locked on entry. Your VOP_INACTIVE code +must unlock the vp prior to returning. +.Pp +For VOP_RECLAIM, the vp will not be locked on entry and should be left +unlocked on return. +.Pp .Sh PSEUDOCODE .Bd -literal int @@ -70,6 +78,7 @@ vop_inactive(struct vnode *vp) */ ...; } + VOP_UNLOCK(vp, 0, p); return 0; } diff --git a/share/man/man9/VOP_LINK.9 b/share/man/man9/VOP_LINK.9 index 0eba06e46dc..0d046dcff7c 100644 --- a/share/man/man9/VOP_LINK.9 +++ b/share/man/man9/VOP_LINK.9 @@ -57,13 +57,12 @@ file vnodes should NOT be released on exit. .Sh LOCKS The directory, .Fa dvp -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. +is locked on entry and should remain locked on return. The file .Fa vp -is not locked on entry. If the VOP routine locks it, it must remember -to unlock it prior to returning. +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. .Sh RETURN VALUES Zero is returned if the file was linked successfully, otherwise an error is returned. diff --git a/share/man/man9/VOP_REMOVE.9 b/share/man/man9/VOP_REMOVE.9 index 05a7e454c82..86a8f065052 100644 --- a/share/man/man9/VOP_REMOVE.9 +++ b/share/man/man9/VOP_REMOVE.9 @@ -59,7 +59,7 @@ Both .Fa dvp and .Fa vp -should be locked on entry and are unlocked and released on exit. +should be locked on entry and remain locked on return. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh PSEUDOCODE