[Sheepdog] [PATCH v2] sheep: fix get_nr_copies()

Liu Yuan namei.unix at gmail.com
Mon Apr 30 19:52:56 CEST 2012


On 05/01/2012 01:23 AM, Christoph Hellwig wrote:

> On Tue, May 01, 2012 at 12:45:43AM +0800, Liu Yuan wrote:
>> From: Liu Yuan <tailai.ly at taobao.com>
>>
>> We should never return anything greater than sys->nr_copies.
>>
>> - use min() to get the better readability
>> - change this function into 'static inline'
> 
> does the inlining really buy us that much?  Making the vnode_info
> structure private to group.c has the big benefit that we force people
> to use accessors and not opencode variants of it.  If we really want
> to optimize it a better thing might be to store a precalculated
> nr_copies value in addition to nr_zones in it.
>


Okay. I'll move it back to group.c

I think it is more important to get it right than optimize
it.get_nr_copies() is subject to change when we implement different
redundant VDI level feature. I don't think we'd benefit pre-calculated
nr_copies much, this would cause trouble when the new introduced.

Thanks,
Yuan



More information about the sheepdog mailing list