OSDN Git Service

btrfs: use a cached_state everywhere in relocation
authorJosef Bacik <josef@toxicpanda.com>
Fri, 30 Sep 2022 20:45:11 +0000 (16:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:36 +0000 (18:00 +0100)
commit9c5c9604631ae5fcdc5124c79d01d75f80b5ffd4
treee1bfb876e131fff0a37664beb1c627850b641e46
parent632ddfa2131f0fea1831bc1f4b28c68faa779156
btrfs: use a cached_state everywhere in relocation

All of the relocation code avoids using the cached state, despite
everywhere using the normal

  lock_extent()
  // do something
  unlock_extent()

pattern.  Fix this by plumbing a cached state throughout all of these
functions in order to allow for less tree searches.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c