diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-11-11 11:50:31 +0000 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:56 +0100 |
commit | cfd7a17d9b4588dd7a29e1a131257bee3e72b766 (patch) | |
tree | 27e7123b120e36781532e51ee332583f5f32ac21 /fs | |
parent | 8ddc8274e4be9a35eafc5bef9ff64d94f452d193 (diff) | |
download | linux-cfd7a17d9b4588dd7a29e1a131257bee3e72b766.tar.bz2 |
btrfs: remove no longer used btrfs_next_extent_map()
There are no more users of btrfs_next_extent_map(), the previous patch
in the series ("btrfs: search for delalloc more efficiently during
lseek/fiemap") removed the last usage of the function, so delete it.
This change is part of a patchset that has the goal to make performance
better for applications that use lseek's SEEK_HOLE and SEEK_DATA modes to
iterate over the extents of a file. Two examples are the cp program from
coreutils 9.0+ and the tar program (when using its --sparse / -S option).
A sample test and results are listed in the changelog of the last patch
in the series:
1/9 btrfs: remove leftover setting of EXTENT_UPTODATE state in an inode's io_tree
2/9 btrfs: add an early exit when searching for delalloc range for lseek/fiemap
3/9 btrfs: skip unnecessary delalloc searches during lseek/fiemap
4/9 btrfs: search for delalloc more efficiently during lseek/fiemap
5/9 btrfs: remove no longer used btrfs_next_extent_map()
6/9 btrfs: allow passing a cached state record to count_range_bits()
7/9 btrfs: update stale comment for count_range_bits()
8/9 btrfs: use cached state when looking for delalloc ranges with fiemap
9/9 btrfs: use cached state when looking for delalloc ranges with lseek
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
Link: https://lore.kernel.org/linux-btrfs/20221106073028.71F9.409509F4@e16-tech.com/
Link: https://lore.kernel.org/linux-btrfs/CAL3q7H5NSVicm7nYBJ7x8fFkDpno8z3PYt5aPU43Bajc1H0h1Q@mail.gmail.com/
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent_map.c | 29 | ||||
-rw-r--r-- | fs/btrfs/extent_map.h | 2 |
2 files changed, 0 insertions, 31 deletions
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c index 4a4362f5cc52..be94030e1dfb 100644 --- a/fs/btrfs/extent_map.c +++ b/fs/btrfs/extent_map.c @@ -529,35 +529,6 @@ static struct extent_map *next_extent_map(const struct extent_map *em) return container_of(next, struct extent_map, rb_node); } -/* - * Get the extent map that immediately follows another one. - * - * @tree: The extent map tree that the extent map belong to. - * Holding read or write access on the tree's lock is required. - * @em: An extent map from the given tree. The caller must ensure that - * between getting @em and between calling this function, the - * extent map @em is not removed from the tree - for example, by - * holding the tree's lock for the duration of those 2 operations. - * - * Returns the extent map that immediately follows @em, or NULL if @em is the - * last extent map in the tree. - */ -struct extent_map *btrfs_next_extent_map(const struct extent_map_tree *tree, - const struct extent_map *em) -{ - struct extent_map *next; - - /* The lock must be acquired either in read mode or write mode. */ - lockdep_assert_held(&tree->lock); - ASSERT(extent_map_in_tree(em)); - - next = next_extent_map(em); - if (next) - refcount_inc(&next->refs); - - return next; -} - static struct extent_map *prev_extent_map(struct extent_map *em) { struct rb_node *prev; diff --git a/fs/btrfs/extent_map.h b/fs/btrfs/extent_map.h index 68d3f2c9ea1d..ad311864272a 100644 --- a/fs/btrfs/extent_map.h +++ b/fs/btrfs/extent_map.h @@ -87,8 +87,6 @@ static inline u64 extent_map_block_end(struct extent_map *em) void extent_map_tree_init(struct extent_map_tree *tree); struct extent_map *lookup_extent_mapping(struct extent_map_tree *tree, u64 start, u64 len); -struct extent_map *btrfs_next_extent_map(const struct extent_map_tree *tree, - const struct extent_map *em); int add_extent_mapping(struct extent_map_tree *tree, struct extent_map *em, int modified); void remove_extent_mapping(struct extent_map_tree *tree, struct extent_map *em); |