]> git.ipfire.org Git - people/ms/linux.git/commit - fs/btrfs/locking.h
btrfs: introduce btrfs_path::recurse
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:46:01 +0000 (11:46 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 7 Oct 2020 10:12:16 +0000 (12:12 +0200)
commit51899412dd95b2d9f50297c527b22ada3da0000c
tree8f5b2c4d45f492cb6b7c917e4af30043314c9690
parent329ced799be881feab445b68163cd3869340cc08
btrfs: introduce btrfs_path::recurse

Our current tree locking stuff allows us to recurse with read locks if
we're already holding the write lock.  This is necessary for the space
cache inode, as we could be holding a lock on the root_tree root when we
need to cache a block group, and thus need to be able to read down the
root_tree to read in the inode cache.

We can get away with this in our current locking, but we won't be able
to with a rwsem.  Handle this by purposefully annotating the places
where we require recursion, so that in the future we can maybe come up
with a way to avoid the recursion.  In the case of the free space inode,
this will be superseded by the free space tree.

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