Re: [PATCH 00/31] btrfs: move extent_io_tree code and cleanups

David Sterba
2022-09-06T18:37:05Z

On Fri, Sep 02, 2022 at 04:16:05PM -0400, Josef Bacik wrote:
> In working on extent tree v2 I got really bogged down in trying to sync work
> between btrfs-progs and the kernel. It basically takes me 3x as long, because
> there's a lot of different things missing in btrfs-progs, so each patchset has
> to be done from scratch and tested completely differently.
>
> Additionally there's just a lot of tech-debt in these areas in general. So
> before tackling the rest of extent-tree-v2 I'm spending some time cleaning up
> things we all know are terrible. This is the first step in that direction,
> finishing the separation of the extent_io_tree code from extent_io.c. I started
> this a while ago, but got bogged down in other things.
>
> This has 3 distinct parts
>
> 1. Cleanup the io_failure_record code. This has been tightly integrated into
> the extent_io_tree code forever without much reason for it. The first part
> of this series moves that handling into it's own tree, and uses our existing
> helpers to reduce the code quite a bit.
>
> 2. Move the code out of extent_io.c. This is easier than previous code moves
> because I did a lot of the prep work earlier. Unfortunately there is one big
> patch that copy and pastes all the core code, since it all depends on itself
> and would be more annoying to move. However the independent parts were
> moved piece by piece.
>
> 3. A wholesale cleanup of the extent_io_tree code. We have a ton of helpers
> here, that have all grown a ton of arguments over the years. I've trimmed
> down the arguments for our core helpers, and hidden the rest internally
> inside of extent-io-tree.c. Additionally I've cleaned up the lock/unlock
> extent bit helpers so we only have one lock_extent/unlock_extent variant that
> gets used everywhere.
>
> I've tested this locally to make sure I didn't break anything. This isn't a
> simple code move so do please review most of it, the patches that start with
> "move X" are pure code move patches, but the rest do change things. Thanks,

As this is mostly simple cleanups or straightfowrad changes I think it's
safe to merge before code freeze. I'll send more comments to the
patches, there are some minor issues or missing commit references to
last code that used some structure when it's removed.

As others noted this patchset conflicts with the series from Christoph,
namely the io_failure_tree removal, but that series is more intrusive
and with pending reviews.