[Ocfs2-devel] [PATCH] Refactor ocfs2_insert_extent for not-merging.

Tao Ma tao.ma at oracle.com
Wed Aug 13 18:13:54 PDT 2008


Mark Fasheh wrote:
> On Thu, Aug 14, 2008 at 01:33:12AM +0800, Tao Ma wrote:
>   
>> From: taoma <taoma at tma-home.cn.oracle.com>
>>
>> Hi Mark,
>> 	Here is the patch we discussed this morning.
>>
>> In xattr bucket, we want to limit the maximum size of a btree leaf,
>> otherwise we'll lose the benefits of hashing because we'll have to search
>> large leaves.
>>
>> So add a new flag in ocfs2_extent_tree which will prevent ocfs2_insert_extent
>> from merging the leaf record even if they are contiguous.
>>     
>
> Ok, this is close... The problem I see here though is that we've gone from
> always merging when possible to *never* merging.
>
> What we want is "don't merge if the resulting extent is larger than a given
> size".
>   
I leave this judgement to the caller itself(the flag) and I think the 
caller should be responsible for telling ocfs2_insert_extent whether the 
new added cluster should be merged or not.
So if the caller say loudly that "please don't merge", we will not 
merge. As for xattr extent tree, I have already judge the situation in 
the caller(ocfs2_add_new_xattr_cluster), so it will not be a problem.
There is also another benefit. In future, other extent tree type may 
have another type of things which will ask ocfs2_insert_extent to "not 
merge", but not because of the leaf size. And we can also handle this.
Make sense?

Regards,
Tao



More information about the Ocfs2-devel mailing list