[sheepdog] [PATCH] object cache: opencode add_to_dirty_tree_and_list()
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Wed Jun 13 04:54:37 CEST 2012
At Wed, 13 Jun 2012 10:31:18 +0800,
Liu Yuan wrote:
>
> On 06/12/2012 11:51 PM, Christoph Hellwig wrote:
> > I like the split between the allocation and the btree/list addition.
> > But why not keep a helper for the latter two as they are always
> > called together?
> >
> >> + assert(!dirty_tree_insert(oc->active_dirty_tree, entry));
> >
> > Calling code with side effects inside assert statements is dangerous
> > as the assert code can be compiled out using -NDEBUG
> >
>
> Is there any better way? I think we can control macro, so -NDEBUG
> wouldn't be a problem.
result = dirty_tree_insert(oc->active_dirty_tree, entry);
assert(result == 0);
Thanks,
Kazutaka
More information about the sheepdog
mailing list