]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: introduce BTRFS_NESTING_LEFT/BTRFS_NESTING_RIGHT
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:46:04 +0000 (11:46 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:16 +0000 (12:12 +0200)
commite30e2a8776a51403dd02549976ef560922adca03
treede61ced135cc6209b53edc8829335969cb9c8ec8
parentd26ab9375d483f0697ffdaa8010f6346177b8419
btrfs: introduce BTRFS_NESTING_LEFT/BTRFS_NESTING_RIGHT

Our lockdep maps are based on rootid+level, however in some cases we
will lock adjacent blocks on the same level, namely in searching forward
or in split/balance.  Because of this lockdep will complain, so we need
a separate subclass to indicate to lockdep that these are different
locks.

lock leaf -> BTRFS_NESTING_NORMAL
  cow leaf -> BTRFS_NESTING_COW
    split leaf
       lock left -> BTRFS_NESTING_LEFT
       lock right -> BTRFS_NESTING_RIGHT

The above graph illustrates the need for this new nesting subclass.

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/ctree.c
fs/btrfs/locking.h