On Sat, Sep 15, 2012 at 07:26:40PM -0700, Philip Guenther wrote:
> On Sat, Sep 15, 2012 at 1:42 AM, Jason McIntyre <[email protected]> wrote:
> > On Sat, Sep 15, 2012 at 10:19:35AM +0200, Michal Mazurek wrote:
> >> > doesn;t the code mean the check is for zero, not "less than or equal to
> >> > zero"?
> >>
> >> Oops, you're right.
> >
> > everything else looks alright. i'll commit it soon if no one objects,
> > though i'd prefer it if another developer would ok it.
> 
> I don't think we, in general, promise to panic.  Note that it won't if
> you compile without the DIAGNOSTIC option.
> 

i think its fine since default is DIAGNOSTIC, but i'm fine with removing
that bit.

> As for the rest of the wording, I think it would be better if it
> mirrored the wording of the vhold() description, say:
> 
>     The vdrop() function decrements the v_holdcnt of the given vnode.  If the
>     vnode is on the vnode hold list and its v_holdcnt and v_usecount
> are both zero,
>     it will be removed from the vnode hold list and added to the free list.
> 
> vhold() and vdrop() really are mirrors of each other like that...
> 
> 
> Philip
> 

thanks, i think that reads better too. ok?
jmc

Index: Makefile
===================================================================
RCS file: /cvs/src/share/man/man9/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- Makefile    21 Jun 2012 18:02:21 -0000      1.171
+++ Makefile    16 Sep 2012 09:53:04 -0000
@@ -373,5 +373,6 @@
 MLINKS+=workq_add_task.9 workq_create.9 \
        workq_add_task.9 workq_queue_task.9 \
        workq_add_task.9 workq_destroy.9
+MLINKS+=vhold.9 vdrop.9
 
 .include <bsd.prog.mk>
Index: vhold.9
===================================================================
RCS file: /cvs/src/share/man/man9/vhold.9,v
retrieving revision 1.6
diff -u -r1.6 vhold.9
--- vhold.9     15 Dec 2009 07:34:58 -0000      1.6
+++ vhold.9     16 Sep 2012 09:53:04 -0000
@@ -31,13 +31,16 @@
 .Dt VHOLD 9
 .Os
 .Sh NAME
-.Nm vhold
+.Nm vhold ,
+.Nm vdrop
 .Nd acquire a hold on a vnode
 .Sh SYNOPSIS
 .Fd #include <sys/param.h>
 .Fd #include <sys/vnode.h>
 .Ft void
 .Fn vhold "struct vnode *vp"
+.Ft void
+.Fn vdrop "struct vnode *vp"
 .Sh DESCRIPTION
 The
 .Fn vhold
@@ -50,6 +53,18 @@
 .Va v_usecount
 are both zero, it will be removed from the free list and
 added to the vnode hold list.
+.Pp
+The
+.Fn vdrop
+function decrements the
+.Va v_holdcnt
+of the given vnode.
+If the vnode is on the vnode hold list and its
+.Va v_holdcnt
+and
+.Va v_usecount
+are both zero, it will be removed from the vnode hold list and
+added to the freed list.
 .Sh SEE ALSO
 .Xr vnode 9
 .Sh AUTHORS

Reply via email to