]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/ioctl.c
btrfs: introduce BTRFS_NESTING_COW for cow'ing blocks
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:46:03 +0000 (11:46 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:16 +0000 (12:12 +0200)
commit9631e4cc1a030aa71dea588cc9a57533b657489f
tree79af53be50c85a8d2fa8aeb0ffb0662506d010c1
parentfd7ba1c1202d15ac96d7b42256550973e12686b5
btrfs: introduce BTRFS_NESTING_COW for cow'ing blocks

When we COW a block we are holding a lock on the original block, and
then we lock the new COW block.  Because our lockdep maps are based on
root + level, this will make lockdep complain.  We need a way to
indicate a subclass for locking the COW'ed block, so plumb through our
btrfs_lock_nesting from btrfs_cow_block down to the btrfs_init_buffer,
and then introduce BTRFS_NESTING_COW to be used for cow'ing blocks.

The reason I've added all this extra infrastructure is because there
will be need of different nesting classes in follow up patches.

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/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/ioctl.c
fs/btrfs/locking.h
fs/btrfs/relocation.c
fs/btrfs/transaction.c