mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
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: Qu Wenruo <wqu@suse.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
6a3a9113ae
commit
e778724a5e
@ -342,7 +342,7 @@ void clear_em_logging(struct btrfs_inode *inode, struct extent_map *em)
|
|||||||
try_merge_map(tree, 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,
|
struct extent_map *em,
|
||||||
int modified)
|
int modified)
|
||||||
{
|
{
|
||||||
@ -351,9 +351,9 @@ static inline void setup_extent_mapping(struct extent_map_tree *tree,
|
|||||||
ASSERT(list_empty(&em->list));
|
ASSERT(list_empty(&em->list));
|
||||||
|
|
||||||
if (modified)
|
if (modified)
|
||||||
list_add(&em->list, &tree->modified_extents);
|
list_add(&em->list, &inode->extent_tree.modified_extents);
|
||||||
else
|
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)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
setup_extent_mapping(tree, em, modified);
|
setup_extent_mapping(inode, em, modified);
|
||||||
|
|
||||||
return 0;
|
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_replace_node_cached(&cur->rb_node, &new->rb_node, &tree->map);
|
||||||
RB_CLEAR_NODE(&cur->rb_node);
|
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)
|
static struct extent_map *next_extent_map(const struct extent_map *em)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user