summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent_map.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2022-11-11 11:50:31 +0000
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:56 +0100
commitcfd7a17d9b4588dd7a29e1a131257bee3e72b766 (patch)
tree27e7123b120e36781532e51ee332583f5f32ac21 /fs/btrfs/extent_map.c
parent8ddc8274e4be9a35eafc5bef9ff64d94f452d193 (diff)
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/btrfs/extent_map.c')
-rw-r--r--fs/btrfs/extent_map.c29
1 files changed, 0 insertions, 29 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;