Commit e778724a authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: pass the extent map tree's inode to setup_extent_mapping()

Extent maps are always associated to an inode's extent map tree, so
there's no need to pass the extent map tree explicitly to
setup_extent_mapping().

In order to facilitate an upcoming change that adds a shrinker for extent
maps, change setup_extent_mapping() to receive the inode instead of its
extent map tree.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6a3a9113
......@@ -342,7 +342,7 @@ void clear_em_logging(struct btrfs_inode *inode, struct extent_map *em)
try_merge_map(tree, em);
}
static inline void setup_extent_mapping(struct extent_map_tree *tree,
static inline void setup_extent_mapping(struct btrfs_inode *inode,
struct extent_map *em,
int modified)
{
......@@ -351,9 +351,9 @@ static inline void setup_extent_mapping(struct extent_map_tree *tree,
ASSERT(list_empty(&em->list));
if (modified)
list_add(&em->list, &tree->modified_extents);
list_add(&em->list, &inode->extent_tree.modified_extents);
else
try_merge_map(tree, em);
try_merge_map(&inode->extent_tree, em);
}
/*
......@@ -381,7 +381,7 @@ static int add_extent_mapping(struct btrfs_inode *inode,
if (ret)
return ret;
setup_extent_mapping(tree, em, modified);
setup_extent_mapping(inode, em, modified);
return 0;
}
......@@ -486,7 +486,7 @@ static void replace_extent_mapping(struct btrfs_inode *inode,
rb_replace_node_cached(&cur->rb_node, &new->rb_node, &tree->map);
RB_CLEAR_NODE(&cur->rb_node);
setup_extent_mapping(tree, new, modified);
setup_extent_mapping(inode, new, modified);
}
static struct extent_map *next_extent_map(const struct extent_map *em)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment