mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
btrfs: pass the extent map tree's inode to clear_em_logging()
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 clear_em_logging(). In order to facilitate an upcoming change that adds a shrinker for extent maps, change clear_em_logging() 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
6c566def95
commit
002f3a2ce8
@ -331,8 +331,10 @@ int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen)
|
||||
|
||||
}
|
||||
|
||||
void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em)
|
||||
void clear_em_logging(struct btrfs_inode *inode, struct extent_map *em)
|
||||
{
|
||||
struct extent_map_tree *tree = &inode->extent_tree;
|
||||
|
||||
lockdep_assert_held_write(&tree->lock);
|
||||
|
||||
em->flags &= ~EXTENT_FLAG_LOGGING;
|
||||
|
@ -129,7 +129,7 @@ void free_extent_map(struct extent_map *em);
|
||||
int __init extent_map_init(void);
|
||||
void __cold extent_map_exit(void);
|
||||
int unpin_extent_cache(struct btrfs_inode *inode, u64 start, u64 len, u64 gen);
|
||||
void clear_em_logging(struct extent_map_tree *tree, struct extent_map *em);
|
||||
void clear_em_logging(struct btrfs_inode *inode, struct extent_map *em);
|
||||
struct extent_map *search_extent_mapping(struct extent_map_tree *tree,
|
||||
u64 start, u64 len);
|
||||
int btrfs_add_extent_mapping(struct btrfs_inode *inode,
|
||||
|
@ -4949,7 +4949,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
|
||||
* private list.
|
||||
*/
|
||||
if (ret) {
|
||||
clear_em_logging(tree, em);
|
||||
clear_em_logging(inode, em);
|
||||
free_extent_map(em);
|
||||
continue;
|
||||
}
|
||||
@ -4958,7 +4958,7 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
|
||||
|
||||
ret = log_one_extent(trans, inode, em, path, ctx);
|
||||
write_lock(&tree->lock);
|
||||
clear_em_logging(tree, em);
|
||||
clear_em_logging(inode, em);
|
||||
free_extent_map(em);
|
||||
}
|
||||
WARN_ON(!list_empty(&extents));
|
||||
|
Loading…
Reference in New Issue
Block a user