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

Johannes Thumshirn
2022-05-17T07:45:10Z

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?