Re: [RFC ONLY 5/8] btrfs: add code to delete raid extent

Qu Wenruo
2022-05-17T08:31:39Z

On 2022/5/17 16:20, Johannes Thumshirn wrote:
> On 17/05/2022 10:15, Qu Wenruo wrote:
>> But btrfs extents are immortal, it can only get freed when every bytes
>> are no longer referred to.
>>
>> Btrfs_drop_extents() is complex because it's working on file extent
>> level, but __btrfs_free_extent() is already working on extent level.
>>
>> Or do you mean, the raid stripe is not really bounded to extent level,
>> but really bounded to file extent level?
>>
>> Then I'm not sure if it's a good idea to do such level mapping then.
>
> It is bound to the file_extent_item as the extent_item is lacking the
> (logical, lenght) information I need.

Then I guess the it would be way more complex than we though.

For file extent we can split it for things like CoW, and it's really too
flex and too complex to me.

The info of logical and length can still be extracted from from extent
item (of course, or we will have way bigger problems).

Furthermore, if we are bounded to extent item, then we even have the
help from delayed refs update code, to help reduce the IO on stripe tree.

Although all those benefits come from the cost of new creative ways to
pass the stripe mapping info to delayed refs...

Thanks,
Qu