[sheepdog] [PATCH v2 2/4] util: introduce a new data type refcnt_t for reference counting

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Jul 10 15:24:41 CEST 2013


At Wed, 10 Jul 2013 15:36:51 +0800,
Liu Yuan wrote:
> 
> On Wed, Jul 10, 2013 at 04:21:03PM +0900, MORITA Kazutaka wrote:
> > At Tue, 9 Jul 2013 16:59:27 +0800,
> > Liu Yuan wrote:
> > > 
> > > I don't think this refcnt_dec_return is atomic operatoin. You should rely on the
> > > atomic_sub_return()...anyway, I am not yet convinced to use wrapper instead of
> > > atomic helpers.
> > 
> > I'd vote for introducing the wrappers.  assert() in refcnt_dec() would
> > help us to detect a bug.
> 
> Get type check and overflow check looks okay to me. I'd suggest name as
> refcount_{dec, inc}. But maybe sometimes we allow refcount < -1 like your
> reclaim patch?

OK, I'll fix it and send v3 later.

Thanks,
Hitoshi



More information about the sheepdog mailing list