[sheepdog] [PATCH v2 8/8] sheep: use node_id_cmp to compare node
Christoph Hellwig
hch at infradead.org
Tue Jun 26 11:03:56 CEST 2012
On Tue, Jun 26, 2012 at 10:32:15AM +0800, Liu Yuan wrote:
> I don't think so. Both for vnode_node_cmp and node_cmp, the only caller
> are bsearch and lfind, which need a prototype of int (*compar)(const
> void *, const void *). It is meaningless to add a wrapper at least for
> now. I also think folding doesn't make sense, this patch need a separate
> one for better review.
Now if you change or move the node_id structure these variant will silently
break. If you use the proper type safe container_of variant you do get
the proper warnings in that case. Moreover the compile will produce
tail calls and thus produce the same executable code if you put the
wrappers into the same file.
More information about the sheepdog
mailing list