btrfs: open code set_extent_defrag
authorDavid Sterba <dsterba@suse.com>
Wed, 24 May 2023 23:04:21 +0000 (01:04 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Jun 2023 11:59:29 +0000 (13:59 +0200)
The helper is used only once.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/defrag.c
fs/btrfs/extent-io-tree.h

index 8065341..4e7a1e0 100644 (file)
@@ -1040,7 +1040,9 @@ static int defrag_one_locked_target(struct btrfs_inode *inode,
        clear_extent_bit(&inode->io_tree, start, start + len - 1,
                         EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING |
                         EXTENT_DEFRAG, cached_state);
-       set_extent_defrag(&inode->io_tree, start, start + len - 1, cached_state);
+       set_extent_bit(&inode->io_tree, start, start + len - 1,
+                      EXTENT_DELALLOC | EXTENT_DEFRAG,
+                      cached_state, GFP_NOFS);
 
        /* Update the page status */
        for (i = start_index - first_index; i <= last_index - first_index; i++) {
index 21766e4..ea344e5 100644 (file)
@@ -202,14 +202,6 @@ static inline int set_extent_delalloc(struct extent_io_tree *tree, u64 start,
                              cached_state, GFP_NOFS);
 }
 
-static inline int set_extent_defrag(struct extent_io_tree *tree, u64 start,
-               u64 end, struct extent_state **cached_state)
-{
-       return set_extent_bit(tree, start, end,
-                             EXTENT_DELALLOC | EXTENT_DEFRAG,
-                             cached_state, GFP_NOFS);
-}
-
 static inline int set_extent_new(struct extent_io_tree *tree, u64 start,
                u64 end)
 {