[Ocfs2-tools-devel] [RFC 2/8] dx_dirs v4: indexed dirs core code in libocfs2

Coly Li coly.li at suse.de
Mon Jan 25 21:45:56 PST 2010



On 2010年01月26日 09:17, Tao Ma Wrote:
> 
> 
> Coly Li wrote:
>>
>> On 2010年01月22日 16:21, Tao Ma Wrote:
>>>
>>> Coly Li wrote:
>>>> This patch contains the core part of current indexed dirs support in
>>>> libocfs2, includes,
>>>> - Indexed tree truncate.
>>>> - Build indexed tree.
>>>> - Insert dx record into indexed tree.
>>>> - Expand inlined dx_root to an extent tree.
>>>> - Rebalance indexed tree.
>>>>
>>>> I worry about whether I use the extent tree code correctly, though I
>>>> tried my best to understand the code, IMHO it's
>>>> still a gray area to me so far. Any review/comment is helpful !
>>>>
>>>> Signed-off-by: Coly Li <coly.li at suse.de>
>>>> Cc: Tao Ma <tao.ma at oracle.com>
>>>> ---
>> [snip]
>>>> --- a/libocfs2/inode.c
>>>> +++ b/libocfs2/inode.c
>>>> @@ -139,6 +139,10 @@ static void ocfs2_swap_inode_second(struct
>>>> ocfs2_dinode *di)
>>>>          sb->s_uuid_hash           = bswap_32(sb->s_uuid_hash);
>>>>          sb->s_first_cluster_group =
>>>> bswap_64(sb->s_first_cluster_group);
>>>>          sb->s_xattr_inline_size   = bswap_16(sb->s_xattr_inline_size);
>>>> +        sb->s_dx_seed[0]          = bswap_32(sb->s_dx_seed[0]);
>>>> +        sb->s_dx_seed[1]          = bswap_32(sb->s_dx_seed[1]);
>>>> +        sb->s_dx_seed[2]          = bswap_32(sb->s_dx_seed[2]);
>>>> +        sb->s_dx_seed[3]          = bswap_32(sb->s_dx_seed[3]);
>>> I just noticed that in ocfs2_super_block we define
>>>     __le32 s_dx_seed[3];
>>> So swap s_dx_seed[3] is wrong?
>>
>> Why do you think it's wrong ?
> er, __le32 s_dx_seed[3] means the array has only three members which is
> 0,1,2. ;)
> 

haha !  I checked it again and again, can not find it myself. Thanks for the hint, fixed now.


-- 
Coly Li
SuSE Labs



More information about the Ocfs2-tools-devel mailing list