btrfs: add assertions for tree == inode->io_tree to extent IO helpers

Add assertions to all helpers that get tree as argument and verify that
it's the same that can be obtained from the inode or from its pages. In
followup patches the redundant arguments and assertions will be removed
one by one.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2020-02-05 19:09:30 +01:00
parent 0ceb34bf46
commit ae6957ebbf
2 changed files with 12 additions and 0 deletions

View file

@ -854,6 +854,8 @@ void btrfs_lock_and_flush_ordered_range(struct extent_io_tree *tree,
struct extent_state *cache = NULL;
struct extent_state **cachedp = &cache;
ASSERT(tree == &inode->io_tree);
if (cached_state)
cachedp = cached_state;