Re: [PATCH 03/31] btrfs: stop using extent_io_tree for io_failure_record's

David Sterba
2022-09-07T18:59:23Z

On Fri, Sep 02, 2022 at 04:16:08PM -0400, Josef Bacik wrote:
> We still have this oddity of stashing the io_failure_record in the
> extent state for the io_failure_tree, which is leftover from when we
> used to stuff private pointers in extent_io_trees.
>
> However this doesn't make a lot of sense for the io failure records, we
> can simply use a normal rb_tree for this. This will allow us to further
> simplify the extent_io_tree code by removing the io_failure_rec pointer
> from the extent state.
>
> Convert the io_failure_tree to an rb tree + spinlock in the inode, and

That's the perfect subject "convert io_failure_tree to rb_tree", we
still use the tree so we're not stopping using it.

Otherwise ok, it'll shave a few bytes from inode too.

> then use our rb tree simple helpers to insert and find failed records.
> This greatly cleans up this code and makes it easier to separate out the
> extent_io_tree code.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>