btrfs: export find_delalloc_range
authorJosef Bacik <josef@toxicpanda.com>
Mon, 23 Sep 2019 14:05:20 +0000 (10:05 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 11:46:47 +0000 (12:46 +0100)
This utilizes internal stuff to the extent_io_tree, so we need to export
it before we move it.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.h
fs/btrfs/extent_io.c

index 83f0f243821483001e84e8bd0ce0fe0f71fb7a15..3de980c44d5eeedd9e71c89549966db41f070945 100644 (file)
@@ -223,5 +223,8 @@ void find_first_clear_extent_bit(struct extent_io_tree *tree, u64 start,
                                 u64 *start_ret, u64 *end_ret, unsigned bits);
 int extent_invalidatepage(struct extent_io_tree *tree,
                          struct page *page, unsigned long offset);
+bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start,
+                              u64 *end, u64 max_bytes,
+                              struct extent_state **cached_state);
 
 #endif /* BTRFS_EXTENT_IO_TREE_H */
index 09fd5e740fa5edd426aebca201f9304114e9d655..5aabbd999bd506ca2e96c25433f93b9129632ff5 100644 (file)
@@ -1686,9 +1686,9 @@ out:
  *
  * true is returned if we find something, false if nothing was in the tree
  */
-static noinline bool find_delalloc_range(struct extent_io_tree *tree,
-                                       u64 *start, u64 *end, u64 max_bytes,
-                                       struct extent_state **cached_state)
+bool btrfs_find_delalloc_range(struct extent_io_tree *tree, u64 *start,
+                              u64 *end, u64 max_bytes,
+                              struct extent_state **cached_state)
 {
        struct rb_node *node;
        struct extent_state *state;
@@ -1806,8 +1806,8 @@ again:
        /* step one, find a bunch of delalloc bytes starting at start */
        delalloc_start = *start;
        delalloc_end = 0;
-       found = find_delalloc_range(tree, &delalloc_start, &delalloc_end,
-                                   max_bytes, &cached_state);
+       found = btrfs_find_delalloc_range(tree, &delalloc_start, &delalloc_end,
+                                         max_bytes, &cached_state);
        if (!found || delalloc_end <= *start) {
                *start = delalloc_start;
                *end = delalloc_end;