Re: [RFC ONLY 1/8] btrfs: add raid stripe tree definitions

Qu Wenruo
2022-05-17T07:56:46Z

On 2022/5/17 15:45, Johannes Thumshirn wrote:
> On 17/05/2022 09:39, Qu Wenruo wrote:
>>>
>>> +struct btrfs_stripe_extent {
>>> + /* btrfs device-id this raid extent lives on */
>>> + __le64 devid;
>>> + /* offset from the devextent start */
>>> + __le64 offset;
>>
>> Considering we have 1G stripe length limit (at least for now), u32 may
>> be large enough?
>>
>> Although u64 is definitely future proof.
>>
>>> +} __attribute__ ((__packed__));
>>> +
>>
>> Mind to mention the key format?
>>
>> My guess is, it's (<logical bytenr>, BTRFS_RAID_STRIPE_KEY, <length>)?
>
> Correct. I'll add a comment here.
>
>>> +struct btrfs_dp_stripe {
>>> + /* array of stripe extents this stripe is comprised of */
>>> + struct btrfs_stripe_extent extents;
>>> +} __attribute__ ((__packed__));
>>> +
>
> Another question, should I add the generation to the
> btrfs_dp_stripe? And does someone have a better name for the struct?

Why you need a new generation member?
To address the problem of possible RAID56 device mismatch?

Thanks,
Qu