At Fri, 29 Aug 2014 12:50:28 +0200,
Justus Winter wrote:
> 
> Quoting Neal H. Walfield (2014-08-29 11:55:07)
> > At Fri, 29 Aug 2014 11:33:44 +0200,
> > Justus Winter wrote:
> > > Previously, peropen objects were created with a reference count of
> > > zero.  Therefore, if diskfs_create_protid fails, passing such an
> > > object to diskfs_release_peropen would lead to a reference count
> > > underflow.
> > > 
> > > * libdiskfs/peropen-make.c (diskfs_peropen_make): Initialize reference
> > > count to one.
> > > * libdiskfs/protid-make.c (diskfs_start_protid): And consume this
> > > reference on success.  Update comment.
> > 
> > Are references really consumed?  (I think 'released' is the right
> > word.)
> 
> Yes, they are.  If diskfs_create_protid succeeds, the reference is in
> the belly of the newly created protid object.
> 
> Also, this terminology is used elsewhere in the Hurd.  Functions that
> contain the term 'release' in their name decrement a reference count
> (e.g. diskfs_release_peropen).  On the other hand, 'consume' indicates
> that a reference is absorbed, e.g. in exec/exec.c (use1),
> pfinet/socket.c (make_sock_user), and trans/fakeroot.c (new_node).

Ok.  I wasn't clear on the semantics.  I find "assume ownership of the
reference" clearer than "consume the reference", but if the Hurd is
already using this terminology, then I won't further dispute it.

Neal

Reply via email to