[Ocfs2-tools-devel] [PATCH 06/22] libocfs2: Make ocfs2_init_group_desc aware of discontig group.
Tao Ma
tao.ma at oracle.com
Thu Apr 1 16:20:48 PDT 2010
Joel Becker wrote:
> On Thu, Apr 01, 2010 at 04:01:23PM +0800, Tao Ma wrote:
>
>> Joel Becker wrote:
>>
>>> On Thu, Apr 01, 2010 at 12:41:10PM +0800, Tao Ma wrote:
>>>
>>>> Pass a parameter named suballoc to ocfs2_init_group_desc
>>>> so that it can init bg_size properly.
>>>>
>>> I hate passing this parameter around. I don't know how to make
>>> it better.
>>>
>> yeah, the only way is that we can add a new member in ocfs2_group_desc,
>> but that are only 2 reserved field(1 le32 and one le64), so I don't want
>> to waste them.
>>
>> Another way is that we separate bg_chain to a __le8
>> - __le16 bg_chain;
>> + __le8 bg_chain;
>> + __le8 bg_flags;
>>
>
> You're at least partially right. In the kernel code, I rely on
> the fact that we know we are a block or cluster allocator before
> deciding to trust bg_list.l_next_free_rec. Then I use l_next_free_rec
> to decide if we're discontig. However, our filesystem is (almost
> always) self-describing. We don't just set i_refcount_loc, we also set
> REFCOUNT_FL.
> It's better if we have a way to know the group descriptor is
> discontiguous without knowing the inode and superblock. Then the
> feature tests are mere sanity.
> We can add bg_flags as you describe above. Another option is to
> see that bg_bitmap + bg_size == offsetof(bg_list). Both work. The
> former is more descriptive, the latter is less invasive. Which works
> for you? Mark?
>
oh yes, it seems be better. That also means that we now are heavily
dependent on bg_size which used to be an auxiliary one. ;)
Regards,
Tao
More information about the Ocfs2-tools-devel
mailing list