[sheepdog] [PATCH v2 8/8] sheep: use node_id_cmp to compare node

Liu Yuan namei.unix at gmail.com
Tue Jun 26 04:32:15 CEST 2012


On 06/26/2012 12:40 AM, Christoph Hellwig wrote:
> On Mon, Jun 25, 2012 at 10:31:50PM +0800, Liu Yuan wrote:
>> From: Liu Yuan <tailai.ly at taobao.com>
>>
>> - remove vnode_node_cmp(), node_cmp()
> 
> I would prefer to keem them as wrappers using container_of to get at
> struct node_id - thay way type safety for the case of struct node_id
> moving around in the structs is kept instead of assuming they are
> the first member.
> 
> The reminder of that patch probably should be folded into the previous
> one.
> 

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.

Thanks,
Yuan




More information about the sheepdog mailing list