]> git.hungrycats.org Git - linux/commitdiff
btrfs: TEMPORARY: make functions in extent-tree.c more visible on stack traces
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Fri, 22 Mar 2019 17:42:21 +0000 (13:42 -0400)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Tue, 26 Mar 2019 18:45:40 +0000 (14:45 -0400)
fs/btrfs/extent-tree.c

index fe1fef3d7eed1d05c509ed4698544be4e42f8f12..e80d0a77a7789f81149e456aab6d568f318e0c8c 100644 (file)
@@ -51,38 +51,38 @@ enum {
        CHUNK_ALLOC_FORCE = 2,
 };
 
-static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
+int __btrfs_free_extent(struct btrfs_trans_handle *trans,
                               struct btrfs_delayed_ref_node *node, u64 parent,
                               u64 root_objectid, u64 owner_objectid,
                               u64 owner_offset, int refs_to_drop,
                               struct btrfs_delayed_extent_op *extra_op);
-static void __run_delayed_extent_op(struct btrfs_delayed_extent_op *extent_op,
+void __run_delayed_extent_op(struct btrfs_delayed_extent_op *extent_op,
                                    struct extent_buffer *leaf,
                                    struct btrfs_extent_item *ei);
-static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
+int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
                                      u64 parent, u64 root_objectid,
                                      u64 flags, u64 owner, u64 offset,
                                      struct btrfs_key *ins, int ref_mod);
-static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
+int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
                                     struct btrfs_delayed_ref_node *node,
                                     struct btrfs_delayed_extent_op *extent_op);
-static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
+int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
                          int force);
-static int find_next_key(struct btrfs_path *path, int level,
+int find_next_key(struct btrfs_path *path, int level,
                         struct btrfs_key *key);
-static void dump_space_info(struct btrfs_fs_info *fs_info,
+void dump_space_info(struct btrfs_fs_info *fs_info,
                            struct btrfs_space_info *info, u64 bytes,
                            int dump_block_groups);
-static int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
+int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
                               u64 num_bytes);
-static void space_info_add_new_bytes(struct btrfs_fs_info *fs_info,
+void space_info_add_new_bytes(struct btrfs_fs_info *fs_info,
                                     struct btrfs_space_info *space_info,
                                     u64 num_bytes);
-static void space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
+void space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
                                     struct btrfs_space_info *space_info,
                                     u64 num_bytes);
 
-static noinline int
+noinline int
 block_group_cache_done(struct btrfs_block_group_cache *cache)
 {
        smp_mb();
@@ -90,7 +90,7 @@ block_group_cache_done(struct btrfs_block_group_cache *cache)
                cache->cached == BTRFS_CACHE_ERROR;
 }
 
-static int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
+int block_group_bits(struct btrfs_block_group_cache *cache, u64 bits)
 {
        return (cache->flags & bits) == bits;
 }
@@ -124,7 +124,7 @@ void btrfs_put_block_group(struct btrfs_block_group_cache *cache)
  * this adds the block group to the fs_info rb tree for the block group
  * cache
  */
-static int btrfs_add_block_group_cache(struct btrfs_fs_info *info,
+int btrfs_add_block_group_cache(struct btrfs_fs_info *info,
                                struct btrfs_block_group_cache *block_group)
 {
        struct rb_node **p;
@@ -164,7 +164,7 @@ static int btrfs_add_block_group_cache(struct btrfs_fs_info *info,
  * This will return the block group at or after bytenr if contains is 0, else
  * it will return the block group that contains the bytenr
  */
-static struct btrfs_block_group_cache *
+struct btrfs_block_group_cache *
 block_group_cache_tree_search(struct btrfs_fs_info *info, u64 bytenr,
                              int contains)
 {
@@ -206,7 +206,7 @@ block_group_cache_tree_search(struct btrfs_fs_info *info, u64 bytenr,
        return ret;
 }
 
-static int add_excluded_extent(struct btrfs_fs_info *fs_info,
+int add_excluded_extent(struct btrfs_fs_info *fs_info,
                               u64 start, u64 num_bytes)
 {
        u64 end = start + num_bytes - 1;
@@ -217,7 +217,7 @@ static int add_excluded_extent(struct btrfs_fs_info *fs_info,
        return 0;
 }
 
-static void free_excluded_extents(struct btrfs_block_group_cache *cache)
+void free_excluded_extents(struct btrfs_block_group_cache *cache)
 {
        struct btrfs_fs_info *fs_info = cache->fs_info;
        u64 start, end;
@@ -231,7 +231,7 @@ static void free_excluded_extents(struct btrfs_block_group_cache *cache)
                          start, end, EXTENT_UPTODATE);
 }
 
-static int exclude_super_stripes(struct btrfs_block_group_cache *cache)
+int exclude_super_stripes(struct btrfs_block_group_cache *cache)
 {
        struct btrfs_fs_info *fs_info = cache->fs_info;
        u64 bytenr;
@@ -288,7 +288,7 @@ static int exclude_super_stripes(struct btrfs_block_group_cache *cache)
        return 0;
 }
 
-static struct btrfs_caching_control *
+struct btrfs_caching_control *
 get_caching_control(struct btrfs_block_group_cache *cache)
 {
        struct btrfs_caching_control *ctl;
@@ -305,14 +305,14 @@ get_caching_control(struct btrfs_block_group_cache *cache)
        return ctl;
 }
 
-static void put_caching_control(struct btrfs_caching_control *ctl)
+void put_caching_control(struct btrfs_caching_control *ctl)
 {
        if (refcount_dec_and_test(&ctl->count))
                kfree(ctl);
 }
 
 #ifdef CONFIG_BTRFS_DEBUG
-static void fragment_free_space(struct btrfs_block_group_cache *block_group)
+void fragment_free_space(struct btrfs_block_group_cache *block_group)
 {
        struct btrfs_fs_info *fs_info = block_group->fs_info;
        u64 start = block_group->key.objectid;
@@ -376,7 +376,7 @@ u64 add_new_free_space(struct btrfs_block_group_cache *block_group,
        return total_added;
 }
 
-static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
+int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
 {
        struct btrfs_block_group_cache *block_group = caching_ctl->block_group;
        struct btrfs_fs_info *fs_info = block_group->fs_info;
@@ -513,7 +513,7 @@ out:
        return ret;
 }
 
-static noinline void caching_thread(struct btrfs_work *work)
+noinline void caching_thread(struct btrfs_work *work)
 {
        struct btrfs_block_group_cache *block_group;
        struct btrfs_fs_info *fs_info;
@@ -564,7 +564,7 @@ static noinline void caching_thread(struct btrfs_work *work)
        btrfs_put_block_group(block_group);
 }
 
-static int cache_block_group(struct btrfs_block_group_cache *cache,
+int cache_block_group(struct btrfs_block_group_cache *cache,
                             int load_cache_only)
 {
        DEFINE_WAIT(wait);
@@ -703,7 +703,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
 /*
  * return the block group that starts at or after bytenr
  */
-static struct btrfs_block_group_cache *
+struct btrfs_block_group_cache *
 btrfs_lookup_first_block_group(struct btrfs_fs_info *info, u64 bytenr)
 {
        return block_group_cache_tree_search(info, bytenr, 0);
@@ -719,7 +719,7 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group(
        return block_group_cache_tree_search(info, bytenr, 1);
 }
 
-static struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info,
+struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info,
                                                  u64 flags)
 {
        struct list_head *head = &info->space_info;
@@ -738,7 +738,7 @@ static struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info,
        return NULL;
 }
 
-static void add_pinned_bytes(struct btrfs_fs_info *fs_info, s64 num_bytes,
+void add_pinned_bytes(struct btrfs_fs_info *fs_info, s64 num_bytes,
                             bool metadata, u64 root_objectid)
 {
        struct btrfs_space_info *space_info;
@@ -1093,7 +1093,7 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
        return BTRFS_REF_TYPE_INVALID;
 }
 
-static u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset)
+u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset)
 {
        u32 high_crc = ~(u32)0;
        u32 low_crc = ~(u32)0;
@@ -1109,7 +1109,7 @@ static u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset)
        return ((u64)high_crc << 31) ^ (u64)low_crc;
 }
 
-static u64 hash_extent_data_ref_item(struct extent_buffer *leaf,
+u64 hash_extent_data_ref_item(struct extent_buffer *leaf,
                                     struct btrfs_extent_data_ref *ref)
 {
        return hash_extent_data_ref(btrfs_extent_data_ref_root(leaf, ref),
@@ -1117,7 +1117,7 @@ static u64 hash_extent_data_ref_item(struct extent_buffer *leaf,
                                    btrfs_extent_data_ref_offset(leaf, ref));
 }
 
-static int match_extent_data_ref(struct extent_buffer *leaf,
+int match_extent_data_ref(struct extent_buffer *leaf,
                                 struct btrfs_extent_data_ref *ref,
                                 u64 root_objectid, u64 owner, u64 offset)
 {
@@ -1128,7 +1128,7 @@ static int match_extent_data_ref(struct extent_buffer *leaf,
        return 1;
 }
 
-static noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
+noinline int lookup_extent_data_ref(struct btrfs_trans_handle *trans,
                                           struct btrfs_path *path,
                                           u64 bytenr, u64 parent,
                                           u64 root_objectid,
@@ -1204,7 +1204,7 @@ fail:
        return err;
 }
 
-static noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
+noinline int insert_extent_data_ref(struct btrfs_trans_handle *trans,
                                           struct btrfs_path *path,
                                           u64 bytenr, u64 parent,
                                           u64 root_objectid, u64 owner,
@@ -1283,7 +1283,7 @@ fail:
        return ret;
 }
 
-static noinline int remove_extent_data_ref(struct btrfs_trans_handle *trans,
+noinline int remove_extent_data_ref(struct btrfs_trans_handle *trans,
                                           struct btrfs_path *path,
                                           int refs_to_drop, int *last_ref)
 {
@@ -1329,7 +1329,7 @@ static noinline int remove_extent_data_ref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static noinline u32 extent_data_ref_count(struct btrfs_path *path,
+noinline u32 extent_data_ref_count(struct btrfs_path *path,
                                          struct btrfs_extent_inline_ref *iref)
 {
        struct btrfs_key key;
@@ -1371,7 +1371,7 @@ static noinline u32 extent_data_ref_count(struct btrfs_path *path,
        return num_refs;
 }
 
-static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
+noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
                                          struct btrfs_path *path,
                                          u64 bytenr, u64 parent,
                                          u64 root_objectid)
@@ -1395,7 +1395,7 @@ static noinline int lookup_tree_block_ref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
+noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
                                          struct btrfs_path *path,
                                          u64 bytenr, u64 parent,
                                          u64 root_objectid)
@@ -1418,7 +1418,7 @@ static noinline int insert_tree_block_ref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static inline int extent_ref_type(u64 parent, u64 owner)
+inline int extent_ref_type(u64 parent, u64 owner)
 {
        int type;
        if (owner < BTRFS_FIRST_FREE_OBJECTID) {
@@ -1435,7 +1435,7 @@ static inline int extent_ref_type(u64 parent, u64 owner)
        return type;
 }
 
-static int find_next_key(struct btrfs_path *path, int level,
+int find_next_key(struct btrfs_path *path, int level,
                         struct btrfs_key *key)
 
 {
@@ -1469,7 +1469,7 @@ static int find_next_key(struct btrfs_path *path, int level,
  * NOTE: inline back refs are ordered in the same way that back ref
  *      items in the tree are ordered.
  */
-static noinline_for_stack
+noinline_for_stack
 int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_path *path,
                                 struct btrfs_extent_inline_ref **ref_ret,
@@ -1662,7 +1662,7 @@ out:
 /*
  * helper to add new inline back ref
  */
-static noinline_for_stack
+noinline_for_stack
 void setup_inline_extent_backref(struct btrfs_fs_info *fs_info,
                                 struct btrfs_path *path,
                                 struct btrfs_extent_inline_ref *iref,
@@ -1723,7 +1723,7 @@ void setup_inline_extent_backref(struct btrfs_fs_info *fs_info,
        btrfs_mark_buffer_dirty(leaf);
 }
 
-static int lookup_extent_backref(struct btrfs_trans_handle *trans,
+int lookup_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_path *path,
                                 struct btrfs_extent_inline_ref **ref_ret,
                                 u64 bytenr, u64 num_bytes, u64 parent,
@@ -1753,7 +1753,7 @@ static int lookup_extent_backref(struct btrfs_trans_handle *trans,
 /*
  * helper to update/remove inline back ref
  */
-static noinline_for_stack
+noinline_for_stack
 void update_inline_extent_backref(struct btrfs_path *path,
                                  struct btrfs_extent_inline_ref *iref,
                                  int refs_to_mod,
@@ -1821,7 +1821,7 @@ void update_inline_extent_backref(struct btrfs_path *path,
        btrfs_mark_buffer_dirty(leaf);
 }
 
-static noinline_for_stack
+noinline_for_stack
 int insert_inline_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_path *path,
                                 u64 bytenr, u64 num_bytes, u64 parent,
@@ -1848,7 +1848,7 @@ int insert_inline_extent_backref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static int insert_extent_backref(struct btrfs_trans_handle *trans,
+int insert_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_path *path,
                                 u64 bytenr, u64 parent, u64 root_objectid,
                                 u64 owner, u64 offset, int refs_to_add)
@@ -1866,7 +1866,7 @@ static int insert_extent_backref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static int remove_extent_backref(struct btrfs_trans_handle *trans,
+int remove_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_path *path,
                                 struct btrfs_extent_inline_ref *iref,
                                 int refs_to_drop, int is_data, int *last_ref)
@@ -1888,7 +1888,7 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans,
 }
 
 #define in_range(b, first, len)        ((b) >= (first) && (b) < (first) + (len))
-static int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len,
+int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len,
                               u64 *discarded_bytes)
 {
        int j, ret = 0;
@@ -2096,7 +2096,7 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
  *                  updating a tree block's flags
  *
  */
-static int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
+int __btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
                                  struct btrfs_delayed_ref_node *node,
                                  u64 parent, u64 root_objectid,
                                  u64 owner, u64 offset, int refs_to_add,
@@ -2152,7 +2152,7 @@ out:
        return ret;
 }
 
-static int run_delayed_data_ref(struct btrfs_trans_handle *trans,
+int run_delayed_data_ref(struct btrfs_trans_handle *trans,
                                struct btrfs_delayed_ref_node *node,
                                struct btrfs_delayed_extent_op *extent_op,
                                int insert_reserved)
@@ -2197,7 +2197,7 @@ static int run_delayed_data_ref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static void __run_delayed_extent_op(struct btrfs_delayed_extent_op *extent_op,
+void __run_delayed_extent_op(struct btrfs_delayed_extent_op *extent_op,
                                    struct extent_buffer *leaf,
                                    struct btrfs_extent_item *ei)
 {
@@ -2215,7 +2215,7 @@ static void __run_delayed_extent_op(struct btrfs_delayed_extent_op *extent_op,
        }
 }
 
-static int run_delayed_extent_op(struct btrfs_trans_handle *trans,
+int run_delayed_extent_op(struct btrfs_trans_handle *trans,
                                 struct btrfs_delayed_ref_head *head,
                                 struct btrfs_delayed_extent_op *extent_op)
 {
@@ -2302,7 +2302,7 @@ out:
        return err;
 }
 
-static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
+int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
                                struct btrfs_delayed_ref_node *node,
                                struct btrfs_delayed_extent_op *extent_op,
                                int insert_reserved)
@@ -2342,7 +2342,7 @@ static int run_delayed_tree_ref(struct btrfs_trans_handle *trans,
 }
 
 /* helper function to actually process a single delayed ref entry */
-static int run_one_delayed_ref(struct btrfs_trans_handle *trans,
+int run_one_delayed_ref(struct btrfs_trans_handle *trans,
                               struct btrfs_delayed_ref_node *node,
                               struct btrfs_delayed_extent_op *extent_op,
                               int insert_reserved)
@@ -2372,7 +2372,7 @@ static int run_one_delayed_ref(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static inline struct btrfs_delayed_ref_node *
+inline struct btrfs_delayed_ref_node *
 select_delayed_ref(struct btrfs_delayed_ref_head *head)
 {
        struct btrfs_delayed_ref_node *ref;
@@ -2396,7 +2396,7 @@ select_delayed_ref(struct btrfs_delayed_ref_head *head)
        return ref;
 }
 
-static void unselect_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs,
+void unselect_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_refs,
                                      struct btrfs_delayed_ref_head *head)
 {
        spin_lock(&delayed_refs->lock);
@@ -2406,7 +2406,7 @@ static void unselect_delayed_ref_head(struct btrfs_delayed_ref_root *delayed_ref
        btrfs_delayed_ref_unlock(head);
 }
 
-static int cleanup_extent_op(struct btrfs_trans_handle *trans,
+int cleanup_extent_op(struct btrfs_trans_handle *trans,
                             struct btrfs_delayed_ref_head *head)
 {
        struct btrfs_delayed_extent_op *extent_op = head->extent_op;
@@ -2425,7 +2425,7 @@ static int cleanup_extent_op(struct btrfs_trans_handle *trans,
        return ret ? ret : 1;
 }
 
-static int cleanup_ref_head(struct btrfs_trans_handle *trans,
+int cleanup_ref_head(struct btrfs_trans_handle *trans,
                            struct btrfs_delayed_ref_head *head)
 {
 
@@ -2505,7 +2505,7 @@ static int cleanup_ref_head(struct btrfs_trans_handle *trans,
        return 0;
 }
 
-static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
+struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
                                        struct btrfs_trans_handle *trans)
 {
        struct btrfs_delayed_ref_root *delayed_refs =
@@ -2538,7 +2538,7 @@ static struct btrfs_delayed_ref_head *btrfs_obtain_ref_head(
        return head;
 }
 
-static int btrfs_run_delayed_refs_for_head(struct btrfs_trans_handle *trans,
+int btrfs_run_delayed_refs_for_head(struct btrfs_trans_handle *trans,
                                    struct btrfs_delayed_ref_head *locked_ref,
                                    unsigned long *run_refs)
 {
@@ -2622,7 +2622,7 @@ static int btrfs_run_delayed_refs_for_head(struct btrfs_trans_handle *trans,
  * Returns 0 on success or if called with an already aborted transaction.
  * Returns -ENOMEM or -EIO on failure and will abort the transaction.
  */
-static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
+noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
                                             unsigned long nr)
 {
        struct btrfs_fs_info *fs_info = trans->fs_info;
@@ -2720,7 +2720,7 @@ static noinline int __btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
  * correlates in most cases to the order added. To expose dependencies on this
  * order, we start to process the tree in the middle instead of the beginning
  */
-static u64 find_middle(struct rb_root *root)
+u64 find_middle(struct rb_root *root)
 {
        struct rb_node *n = root->rb_node;
        struct btrfs_delayed_ref_node *entry;
@@ -2757,7 +2757,7 @@ static u64 find_middle(struct rb_root *root)
 }
 #endif
 
-static inline u64 heads_to_leaves(struct btrfs_fs_info *fs_info, u64 heads)
+inline u64 heads_to_leaves(struct btrfs_fs_info *fs_info, u64 heads)
 {
        u64 num_bytes;
 
@@ -2857,13 +2857,13 @@ struct async_delayed_refs {
        struct btrfs_work work;
 };
 
-static inline struct async_delayed_refs *
+inline struct async_delayed_refs *
 to_async_delayed_refs(struct btrfs_work *work)
 {
        return container_of(work, struct async_delayed_refs, work);
 }
 
-static void delayed_ref_async_start(struct btrfs_work *work)
+void delayed_ref_async_start(struct btrfs_work *work)
 {
        struct async_delayed_refs *async = to_async_delayed_refs(work);
        struct btrfs_trans_handle *trans;
@@ -3031,7 +3031,7 @@ int btrfs_set_disk_extent_flags(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static noinline int check_delayed_ref(struct btrfs_root *root,
+noinline int check_delayed_ref(struct btrfs_root *root,
                                      struct btrfs_path *path,
                                      u64 objectid, u64 offset, u64 bytenr)
 {
@@ -3111,7 +3111,7 @@ static noinline int check_delayed_ref(struct btrfs_root *root,
        return ret;
 }
 
-static noinline int check_committed_ref(struct btrfs_root *root,
+noinline int check_committed_ref(struct btrfs_root *root,
                                        struct btrfs_path *path,
                                        u64 objectid, u64 offset, u64 bytenr)
 {
@@ -3204,7 +3204,7 @@ out:
        return ret;
 }
 
-static int __btrfs_mod_ref(struct btrfs_trans_handle *trans,
+int __btrfs_mod_ref(struct btrfs_trans_handle *trans,
                           struct btrfs_root *root,
                           struct extent_buffer *buf,
                           int full_backref, int inc)
@@ -3292,7 +3292,7 @@ int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
        return __btrfs_mod_ref(trans, root, buf, full_backref, 0);
 }
 
-static int write_one_cache_group(struct btrfs_trans_handle *trans,
+int write_one_cache_group(struct btrfs_trans_handle *trans,
                                 struct btrfs_fs_info *fs_info,
                                 struct btrfs_path *path,
                                 struct btrfs_block_group_cache *cache)
@@ -3319,7 +3319,7 @@ fail:
 
 }
 
-static struct btrfs_block_group_cache *
+struct btrfs_block_group_cache *
 next_block_group(struct btrfs_fs_info *fs_info,
                 struct btrfs_block_group_cache *cache)
 {
@@ -3347,7 +3347,7 @@ next_block_group(struct btrfs_fs_info *fs_info,
        return cache;
 }
 
-static int cache_save_setup(struct btrfs_block_group_cache *block_group,
+int cache_save_setup(struct btrfs_block_group_cache *block_group,
                            struct btrfs_trans_handle *trans,
                            struct btrfs_path *path)
 {
@@ -3896,7 +3896,7 @@ void btrfs_wait_nocow_writers(struct btrfs_block_group_cache *bg)
        wait_var_event(&bg->nocow_writers, !atomic_read(&bg->nocow_writers));
 }
 
-static const char *alloc_name(u64 flags)
+const char *alloc_name(u64 flags)
 {
        switch (flags) {
        case BTRFS_BLOCK_GROUP_METADATA|BTRFS_BLOCK_GROUP_DATA:
@@ -3913,7 +3913,7 @@ static const char *alloc_name(u64 flags)
        };
 }
 
-static int create_space_info(struct btrfs_fs_info *info, u64 flags)
+int create_space_info(struct btrfs_fs_info *info, u64 flags)
 {
 
        struct btrfs_space_info *space_info;
@@ -3958,7 +3958,7 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags)
        return ret;
 }
 
-static void update_space_info(struct btrfs_fs_info *info, u64 flags,
+void update_space_info(struct btrfs_fs_info *info, u64 flags,
                             u64 total_bytes, u64 bytes_used,
                             u64 bytes_readonly,
                             struct btrfs_space_info **space_info)
@@ -3984,7 +3984,7 @@ static void update_space_info(struct btrfs_fs_info *info, u64 flags,
        *space_info = found;
 }
 
-static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
+void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
 {
        u64 extra_flags = chunk_to_extended(flags) &
                                BTRFS_EXTENDED_PROFILE_MASK;
@@ -4005,7 +4005,7 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
  *
  * should be called with balance_lock held
  */
-static u64 get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
+u64 get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
 {
        struct btrfs_balance_control *bctl = fs_info->balance_ctl;
        u64 target = 0;
@@ -4034,7 +4034,7 @@ static u64 get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
  * progress (either running or paused) picks the target profile (if it's
  * already available), otherwise falls back to plain reducing.
  */
-static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags)
+u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags)
 {
        u64 num_devices = fs_info->fs_devices->rw_devices;
        u64 target;
@@ -4079,7 +4079,7 @@ static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags)
        return extended_to_chunk(flags | allowed);
 }
 
-static u64 get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
+u64 get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
 {
        unsigned seq;
        u64 flags;
@@ -4099,7 +4099,7 @@ static u64 get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
        return btrfs_reduce_alloc_profile(fs_info, flags);
 }
 
-static u64 get_alloc_profile_by_root(struct btrfs_root *root, int data)
+u64 get_alloc_profile_by_root(struct btrfs_root *root, int data)
 {
        struct btrfs_fs_info *fs_info = root->fs_info;
        u64 flags;
@@ -4131,7 +4131,7 @@ u64 btrfs_system_alloc_profile(struct btrfs_fs_info *fs_info)
        return get_alloc_profile(fs_info, BTRFS_BLOCK_GROUP_SYSTEM);
 }
 
-static u64 btrfs_space_info_used(struct btrfs_space_info *s_info,
+u64 btrfs_space_info_used(struct btrfs_space_info *s_info,
                                 bool may_use_included)
 {
        ASSERT(s_info);
@@ -4339,7 +4339,7 @@ void btrfs_free_reserved_data_space(struct inode *inode,
        btrfs_qgroup_free_data(inode, reserved, start, len);
 }
 
-static void force_metadata_allocation(struct btrfs_fs_info *info)
+void force_metadata_allocation(struct btrfs_fs_info *info)
 {
        struct list_head *head = &info->space_info;
        struct btrfs_space_info *found;
@@ -4352,12 +4352,12 @@ static void force_metadata_allocation(struct btrfs_fs_info *info)
        rcu_read_unlock();
 }
 
-static inline u64 calc_global_rsv_need_space(struct btrfs_block_rsv *global)
+inline u64 calc_global_rsv_need_space(struct btrfs_block_rsv *global)
 {
        return (global->size << 1);
 }
 
-static int should_alloc_chunk(struct btrfs_fs_info *fs_info,
+int should_alloc_chunk(struct btrfs_fs_info *fs_info,
                              struct btrfs_space_info *sinfo, int force)
 {
        struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv;
@@ -4392,7 +4392,7 @@ static int should_alloc_chunk(struct btrfs_fs_info *fs_info,
        return 1;
 }
 
-static u64 get_profile_num_devs(struct btrfs_fs_info *fs_info, u64 type)
+u64 get_profile_num_devs(struct btrfs_fs_info *fs_info, u64 type)
 {
        u64 num_dev;
 
@@ -4476,7 +4476,7 @@ void check_system_chunk(struct btrfs_trans_handle *trans, u64 type)
  *    - return 1 if it successfully allocates a chunk,
  *    - return errors including -ENOSPC otherwise.
  */
-static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
+int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
                          int force)
 {
        struct btrfs_fs_info *fs_info = trans->fs_info;
@@ -4596,7 +4596,7 @@ out:
        return ret;
 }
 
-static int can_overcommit(struct btrfs_fs_info *fs_info,
+int can_overcommit(struct btrfs_fs_info *fs_info,
                          struct btrfs_space_info *space_info, u64 bytes,
                          enum btrfs_reserve_flush_enum flush,
                          bool system_chunk)
@@ -4659,7 +4659,7 @@ static int can_overcommit(struct btrfs_fs_info *fs_info,
        return 0;
 }
 
-static void btrfs_writeback_inodes_sb_nr(struct btrfs_fs_info *fs_info,
+void btrfs_writeback_inodes_sb_nr(struct btrfs_fs_info *fs_info,
                                         unsigned long nr_pages, int nr_items)
 {
        struct super_block *sb = fs_info->sb;
@@ -4681,7 +4681,7 @@ static void btrfs_writeback_inodes_sb_nr(struct btrfs_fs_info *fs_info,
        }
 }
 
-static inline u64 calc_reclaim_items_nr(struct btrfs_fs_info *fs_info,
+inline u64 calc_reclaim_items_nr(struct btrfs_fs_info *fs_info,
                                        u64 to_reclaim)
 {
        u64 bytes;
@@ -4699,7 +4699,7 @@ static inline u64 calc_reclaim_items_nr(struct btrfs_fs_info *fs_info,
 /*
  * shrink metadata reservation for delalloc
  */
-static void shrink_delalloc(struct btrfs_fs_info *fs_info, u64 to_reclaim,
+void shrink_delalloc(struct btrfs_fs_info *fs_info, u64 to_reclaim,
                            u64 orig, bool wait_ordered)
 {
        struct btrfs_space_info *space_info;
@@ -4788,7 +4788,7 @@ struct reserve_ticket {
  * get us somewhere and then commit the transaction if it does.  Otherwise it
  * will return -ENOSPC.
  */
-static int may_commit_transaction(struct btrfs_fs_info *fs_info,
+int may_commit_transaction(struct btrfs_fs_info *fs_info,
                                  struct btrfs_space_info *space_info)
 {
        struct reserve_ticket *ticket = NULL;
@@ -4852,7 +4852,7 @@ commit:
  * and may fail for various reasons. The caller is supposed to examine the
  * state of @space_info to detect the outcome.
  */
-static void flush_space(struct btrfs_fs_info *fs_info,
+void flush_space(struct btrfs_fs_info *fs_info,
                       struct btrfs_space_info *space_info, u64 num_bytes,
                       int state)
 {
@@ -4908,7 +4908,7 @@ static void flush_space(struct btrfs_fs_info *fs_info,
        return;
 }
 
-static inline u64
+inline u64
 btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info,
                                 struct btrfs_space_info *space_info,
                                 bool system_chunk)
@@ -4947,7 +4947,7 @@ btrfs_calc_reclaim_metadata_size(struct btrfs_fs_info *fs_info,
        return to_reclaim;
 }
 
-static inline int need_do_async_reclaim(struct btrfs_fs_info *fs_info,
+inline int need_do_async_reclaim(struct btrfs_fs_info *fs_info,
                                        struct btrfs_space_info *space_info,
                                        u64 used, bool system_chunk)
 {
@@ -4965,7 +4965,7 @@ static inline int need_do_async_reclaim(struct btrfs_fs_info *fs_info,
                !test_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state));
 }
 
-static void wake_all_tickets(struct list_head *head)
+void wake_all_tickets(struct list_head *head)
 {
        struct reserve_ticket *ticket;
 
@@ -4982,7 +4982,7 @@ static void wake_all_tickets(struct list_head *head)
  * will loop and continuously try to flush as long as we are making progress.
  * We count progress as clearing off tickets each time we have to loop.
  */
-static void btrfs_async_reclaim_metadata_space(struct work_struct *work)
+void btrfs_async_reclaim_metadata_space(struct work_struct *work)
 {
        struct btrfs_fs_info *fs_info;
        struct btrfs_space_info *space_info;
@@ -5044,7 +5044,7 @@ void btrfs_init_async_reclaim_work(struct work_struct *work)
        INIT_WORK(work, btrfs_async_reclaim_metadata_space);
 }
 
-static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
+void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
                                            struct btrfs_space_info *space_info,
                                            struct reserve_ticket *ticket)
 {
@@ -5080,7 +5080,7 @@ static void priority_reclaim_metadata_space(struct btrfs_fs_info *fs_info,
        } while (flush_state < COMMIT_TRANS);
 }
 
-static int wait_reserve_ticket(struct btrfs_fs_info *fs_info,
+int wait_reserve_ticket(struct btrfs_fs_info *fs_info,
                               struct btrfs_space_info *space_info,
                               struct reserve_ticket *ticket, u64 orig_bytes)
 
@@ -5131,7 +5131,7 @@ static int wait_reserve_ticket(struct btrfs_fs_info *fs_info,
  * regain reservations will be made and this will fail if there is not enough
  * space already.
  */
-static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
+int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
                                    struct btrfs_space_info *space_info,
                                    u64 orig_bytes,
                                    enum btrfs_reserve_flush_enum flush,
@@ -5251,7 +5251,7 @@ static int __reserve_metadata_bytes(struct btrfs_fs_info *fs_info,
  * regain reservations will be made and this will fail if there is not enough
  * space already.
  */
-static int reserve_metadata_bytes(struct btrfs_root *root,
+int reserve_metadata_bytes(struct btrfs_root *root,
                                  struct btrfs_block_rsv *block_rsv,
                                  u64 orig_bytes,
                                  enum btrfs_reserve_flush_enum flush)
@@ -5281,7 +5281,7 @@ static int reserve_metadata_bytes(struct btrfs_root *root,
        return ret;
 }
 
-static struct btrfs_block_rsv *get_block_rsv(
+struct btrfs_block_rsv *get_block_rsv(
                                        const struct btrfs_trans_handle *trans,
                                        const struct btrfs_root *root)
 {
@@ -5302,7 +5302,7 @@ static struct btrfs_block_rsv *get_block_rsv(
        return block_rsv;
 }
 
-static int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
+int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
                               u64 num_bytes)
 {
        int ret = -ENOSPC;
@@ -5317,7 +5317,7 @@ static int block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
        return ret;
 }
 
-static void block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
+void block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
                                u64 num_bytes, bool update_size)
 {
        spin_lock(&block_rsv->lock);
@@ -5358,7 +5358,7 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
  * This is for space we already have accounted in space_info->bytes_may_use, so
  * basically when we're returning space from block_rsv's.
  */
-static void space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
+void space_info_add_old_bytes(struct btrfs_fs_info *fs_info,
                                     struct btrfs_space_info *space_info,
                                     u64 num_bytes)
 {
@@ -5418,7 +5418,7 @@ again:
  * space_info->bytes_may_use yet.  So if we allocate a chunk or unpin an extent
  * we use this helper.
  */
-static void space_info_add_new_bytes(struct btrfs_fs_info *fs_info,
+void space_info_add_new_bytes(struct btrfs_fs_info *fs_info,
                                     struct btrfs_space_info *space_info,
                                     u64 num_bytes)
 {
@@ -5455,7 +5455,7 @@ again:
        }
 }
 
-static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
+u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
                                    struct btrfs_block_rsv *block_rsv,
                                    struct btrfs_block_rsv *dest, u64 num_bytes,
                                    u64 *qgroup_to_release_ret)
@@ -5636,7 +5636,7 @@ int btrfs_block_rsv_refill(struct btrfs_root *root,
  * or return if we already have enough space.  This will also handle the resreve
  * tracepoint for the reserved amount.
  */
-static int btrfs_inode_rsv_refill(struct btrfs_inode *inode,
+int btrfs_inode_rsv_refill(struct btrfs_inode *inode,
                                  enum btrfs_reserve_flush_enum flush)
 {
        struct btrfs_root *root = inode->root;
@@ -5685,7 +5685,7 @@ static int btrfs_inode_rsv_refill(struct btrfs_inode *inode,
  * This is the same as btrfs_block_rsv_release, except that it handles the
  * tracepoint for the reservation.
  */
-static void btrfs_inode_rsv_release(struct btrfs_inode *inode, bool qgroup_free)
+void btrfs_inode_rsv_release(struct btrfs_inode *inode, bool qgroup_free)
 {
        struct btrfs_fs_info *fs_info = inode->root->fs_info;
        struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv;
@@ -5722,7 +5722,7 @@ void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
        block_rsv_release_bytes(fs_info, block_rsv, global_rsv, num_bytes, NULL);
 }
 
-static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
+void update_global_block_rsv(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_block_rsv *block_rsv = &fs_info->global_block_rsv;
        struct btrfs_space_info *sinfo = block_rsv->space_info;
@@ -5772,7 +5772,7 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
        spin_unlock(&sinfo->lock);
 }
 
-static void init_global_block_rsv(struct btrfs_fs_info *fs_info)
+void init_global_block_rsv(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_space_info *space_info;
 
@@ -5796,7 +5796,7 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info)
        update_global_block_rsv(fs_info);
 }
 
-static void release_global_block_rsv(struct btrfs_fs_info *fs_info)
+void release_global_block_rsv(struct btrfs_fs_info *fs_info)
 {
        block_rsv_release_bytes(fs_info, &fs_info->global_block_rsv, NULL,
                                (u64)-1, NULL);
@@ -5881,7 +5881,7 @@ void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
        btrfs_block_rsv_release(fs_info, rsv, (u64)-1);
 }
 
-static void btrfs_calculate_inode_block_rsv_size(struct btrfs_fs_info *fs_info,
+void btrfs_calculate_inode_block_rsv_size(struct btrfs_fs_info *fs_info,
                                                 struct btrfs_inode *inode)
 {
        struct btrfs_block_rsv *block_rsv = &inode->block_rsv;
@@ -6091,7 +6091,7 @@ void btrfs_delalloc_release_space(struct inode *inode,
        btrfs_free_reserved_data_space(inode, reserved, start, len);
 }
 
-static int update_block_group(struct btrfs_trans_handle *trans,
+int update_block_group(struct btrfs_trans_handle *trans,
                              struct btrfs_fs_info *info, u64 bytenr,
                              u64 num_bytes, int alloc)
 {
@@ -6193,7 +6193,7 @@ static int update_block_group(struct btrfs_trans_handle *trans,
        return 0;
 }
 
-static u64 first_logical_byte(struct btrfs_fs_info *fs_info, u64 search_start)
+u64 first_logical_byte(struct btrfs_fs_info *fs_info, u64 search_start)
 {
        struct btrfs_block_group_cache *cache;
        u64 bytenr;
@@ -6215,7 +6215,7 @@ static u64 first_logical_byte(struct btrfs_fs_info *fs_info, u64 search_start)
        return bytenr;
 }
 
-static int pin_down_extent(struct btrfs_fs_info *fs_info,
+int pin_down_extent(struct btrfs_fs_info *fs_info,
                           struct btrfs_block_group_cache *cache,
                           u64 bytenr, u64 num_bytes, int reserved)
 {
@@ -6285,7 +6285,7 @@ int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info,
        return ret;
 }
 
-static int __exclude_logged_extent(struct btrfs_fs_info *fs_info,
+int __exclude_logged_extent(struct btrfs_fs_info *fs_info,
                                   u64 start, u64 num_bytes)
 {
        int ret;
@@ -6363,7 +6363,7 @@ int btrfs_exclude_logged_extents(struct btrfs_fs_info *fs_info,
        return ret;
 }
 
-static void
+void
 btrfs_inc_block_group_reservations(struct btrfs_block_group_cache *bg)
 {
        atomic_inc(&bg->reservations);
@@ -6418,7 +6418,7 @@ void btrfs_wait_block_group_reservations(struct btrfs_block_group_cache *bg)
  * reservation and the block group has become read only we cannot make the
  * reservation and return -EAGAIN, otherwise this function always succeeds.
  */
-static int btrfs_add_reserved_bytes(struct btrfs_block_group_cache *cache,
+int btrfs_add_reserved_bytes(struct btrfs_block_group_cache *cache,
                                    u64 ram_bytes, u64 num_bytes, int delalloc)
 {
        struct btrfs_space_info *space_info = cache->space_info;
@@ -6452,7 +6452,7 @@ static int btrfs_add_reserved_bytes(struct btrfs_block_group_cache *cache,
  * reserve set to 0 in order to clear the reservation.
  */
 
-static void btrfs_free_reserved_bytes(struct btrfs_block_group_cache *cache,
+void btrfs_free_reserved_bytes(struct btrfs_block_group_cache *cache,
                                      u64 num_bytes, int delalloc)
 {
        struct btrfs_space_info *space_info = cache->space_info;
@@ -6504,7 +6504,7 @@ void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info)
  * Returns the free cluster for the given space info and sets empty_cluster to
  * what it should be based on the mount options.
  */
-static struct btrfs_free_cluster *
+struct btrfs_free_cluster *
 fetch_cluster_info(struct btrfs_fs_info *fs_info,
                   struct btrfs_space_info *space_info, u64 *empty_cluster)
 {
@@ -6529,7 +6529,7 @@ fetch_cluster_info(struct btrfs_fs_info *fs_info,
        return ret;
 }
 
-static int unpin_extent_range(struct btrfs_fs_info *fs_info,
+int unpin_extent_range(struct btrfs_fs_info *fs_info,
                              u64 start, u64 end,
                              const bool return_free_space)
 {
@@ -6696,7 +6696,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans)
        return 0;
 }
 
-static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
+int __btrfs_free_extent(struct btrfs_trans_handle *trans,
                               struct btrfs_delayed_ref_node *node, u64 parent,
                               u64 root_objectid, u64 owner_objectid,
                               u64 owner_offset, int refs_to_drop,
@@ -6938,7 +6938,7 @@ out:
  * a given extent, and if there are no other delayed refs to be processed, it
  * removes it from the tree.
  */
-static noinline int check_ref_cleanup(struct btrfs_trans_handle *trans,
+noinline int check_ref_cleanup(struct btrfs_trans_handle *trans,
                                      u64 bytenr)
 {
        struct btrfs_delayed_ref_head *head;
@@ -7134,7 +7134,7 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans,
  * Callers of this must check if cache->cached == BTRFS_CACHE_ERROR before using
  * any of the information in this block group.
  */
-static noinline void
+noinline void
 wait_block_group_cache_progress(struct btrfs_block_group_cache *cache,
                                u64 num_bytes)
 {
@@ -7150,7 +7150,7 @@ wait_block_group_cache_progress(struct btrfs_block_group_cache *cache,
        put_caching_control(caching_ctl);
 }
 
-static noinline int
+noinline int
 wait_block_group_cache_done(struct btrfs_block_group_cache *cache)
 {
        struct btrfs_caching_control *caching_ctl;
@@ -7174,7 +7174,7 @@ enum btrfs_loop_type {
        LOOP_NO_EMPTY_SIZE = 3,
 };
 
-static inline void
+inline void
 btrfs_lock_block_group(struct btrfs_block_group_cache *cache,
                       int delalloc)
 {
@@ -7182,7 +7182,7 @@ btrfs_lock_block_group(struct btrfs_block_group_cache *cache,
                down_read(&cache->data_rwsem);
 }
 
-static inline void
+inline void
 btrfs_grab_block_group(struct btrfs_block_group_cache *cache,
                       int delalloc)
 {
@@ -7191,7 +7191,7 @@ btrfs_grab_block_group(struct btrfs_block_group_cache *cache,
                down_read(&cache->data_rwsem);
 }
 
-static struct btrfs_block_group_cache *
+struct btrfs_block_group_cache *
 btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
                   struct btrfs_free_cluster *cluster,
                   int delalloc)
@@ -7229,7 +7229,7 @@ btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
        }
 }
 
-static inline void
+inline void
 btrfs_release_block_group(struct btrfs_block_group_cache *cache,
                         int delalloc)
 {
@@ -7249,7 +7249,7 @@ btrfs_release_block_group(struct btrfs_block_group_cache *cache,
  * If there is no suitable free space, we will record the max size of
  * the free space extent currently.
  */
-static noinline int find_free_extent(struct btrfs_fs_info *fs_info,
+noinline int find_free_extent(struct btrfs_fs_info *fs_info,
                                u64 ram_bytes, u64 num_bytes, u64 empty_size,
                                u64 hint_byte, struct btrfs_key *ins,
                                u64 flags, int delalloc)
@@ -7734,7 +7734,7 @@ out:
        return ret;
 }
 
-static void dump_space_info(struct btrfs_fs_info *fs_info,
+void dump_space_info(struct btrfs_fs_info *fs_info,
                            struct btrfs_space_info *info, u64 bytes,
                            int dump_block_groups)
 {
@@ -7860,7 +7860,7 @@ again:
        return ret;
 }
 
-static int __btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
+int __btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
                                        u64 start, u64 len,
                                        int pin, int delalloc)
 {
@@ -7900,7 +7900,7 @@ int btrfs_free_and_pin_reserved_extent(struct btrfs_fs_info *fs_info,
        return __btrfs_free_reserved_extent(fs_info, start, len, 1, 0);
 }
 
-static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
+int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
                                      u64 parent, u64 root_objectid,
                                      u64 flags, u64 owner, u64 offset,
                                      struct btrfs_key *ins, int ref_mod)
@@ -7974,7 +7974,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
+int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
                                     struct btrfs_delayed_ref_node *node,
                                     struct btrfs_delayed_extent_op *extent_op)
 {
@@ -8131,7 +8131,7 @@ int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static struct extent_buffer *
+struct extent_buffer *
 btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
                      u64 bytenr, int level, u64 owner)
 {
@@ -8193,7 +8193,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
        return buf;
 }
 
-static struct btrfs_block_rsv *
+struct btrfs_block_rsv *
 use_block_rsv(struct btrfs_trans_handle *trans,
              struct btrfs_root *root, u32 blocksize)
 {
@@ -8248,7 +8248,7 @@ try_reserve:
        return ERR_PTR(ret);
 }
 
-static void unuse_block_rsv(struct btrfs_fs_info *fs_info,
+void unuse_block_rsv(struct btrfs_fs_info *fs_info,
                            struct btrfs_block_rsv *block_rsv, u32 blocksize)
 {
        block_rsv_add_bytes(block_rsv, blocksize, false);
@@ -8365,7 +8365,7 @@ struct walk_control {
 #define DROP_REFERENCE 1
 #define UPDATE_BACKREF 2
 
-static noinline void reada_walk_down(struct btrfs_trans_handle *trans,
+noinline void reada_walk_down(struct btrfs_trans_handle *trans,
                                     struct btrfs_root *root,
                                     struct walk_control *wc,
                                     struct btrfs_path *path)
@@ -8453,7 +8453,7 @@ reada:
  *
  * NOTE: return value 1 means we should stop walking down.
  */
-static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
+noinline int walk_down_proc(struct btrfs_trans_handle *trans,
                                   struct btrfs_root *root,
                                   struct btrfs_path *path,
                                   struct walk_control *wc, int lookup_info)
@@ -8535,7 +8535,7 @@ static noinline int walk_down_proc(struct btrfs_trans_handle *trans,
  *
  * NOTE: return value 1 means we should stop walking down.
  */
-static noinline int do_walk_down(struct btrfs_trans_handle *trans,
+noinline int do_walk_down(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root,
                                 struct btrfs_path *path,
                                 struct walk_control *wc, int *lookup_info)
@@ -8722,7 +8722,7 @@ out_unlock:
  *
  * NOTE: return value 1 means we should stop walking up.
  */
-static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
+noinline int walk_up_proc(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root,
                                 struct btrfs_path *path,
                                 struct walk_control *wc)
@@ -8827,7 +8827,7 @@ owner_mismatch:
        return -EUCLEAN;
 }
 
-static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
+noinline int walk_down_tree(struct btrfs_trans_handle *trans,
                                   struct btrfs_root *root,
                                   struct btrfs_path *path,
                                   struct walk_control *wc)
@@ -8859,7 +8859,7 @@ static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
        return 0;
 }
 
-static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
+noinline int walk_up_tree(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root,
                                 struct btrfs_path *path,
                                 struct walk_control *wc, int max_level)
@@ -9198,7 +9198,7 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
        return ret;
 }
 
-static u64 update_block_group_flags(struct btrfs_fs_info *fs_info, u64 flags)
+u64 update_block_group_flags(struct btrfs_fs_info *fs_info, u64 flags)
 {
        u64 num_devices;
        u64 stripped;
@@ -9247,7 +9247,7 @@ static u64 update_block_group_flags(struct btrfs_fs_info *fs_info, u64 flags)
        return flags;
 }
 
-static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
+int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force)
 {
        struct btrfs_space_info *sinfo = cache->space_info;
        u64 num_bytes;
@@ -9575,7 +9575,7 @@ out:
        return ret;
 }
 
-static int find_first_block_group(struct btrfs_fs_info *fs_info,
+int find_first_block_group(struct btrfs_fs_info *fs_info,
                                  struct btrfs_path *path,
                                  struct btrfs_key *key)
 {
@@ -9824,7 +9824,7 @@ void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info)
                           "failed to add kobject for block cache, ignoring");
 }
 
-static void link_block_group(struct btrfs_block_group_cache *cache)
+void link_block_group(struct btrfs_block_group_cache *cache)
 {
        struct btrfs_space_info *space_info = cache->space_info;
        struct btrfs_fs_info *fs_info = cache->fs_info;
@@ -9854,7 +9854,7 @@ static void link_block_group(struct btrfs_block_group_cache *cache)
        }
 }
 
-static struct btrfs_block_group_cache *
+struct btrfs_block_group_cache *
 btrfs_create_block_group_cache(struct btrfs_fs_info *fs_info,
                               u64 start, u64 size)
 {
@@ -9901,7 +9901,7 @@ btrfs_create_block_group_cache(struct btrfs_fs_info *fs_info,
  * Iterate all chunks and verify that each of them has the corresponding block
  * group
  */
-static int check_chunk_block_group_mappings(struct btrfs_fs_info *fs_info)
+int check_chunk_block_group_mappings(struct btrfs_fs_info *fs_info)
 {
        struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree;
        struct extent_map *em;
@@ -10240,7 +10240,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, u64 bytes_used,
        return 0;
 }
 
-static void clear_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
+void clear_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
 {
        u64 extra_flags = chunk_to_extended(flags) &
                                BTRFS_EXTENDED_PROFILE_MASK;
@@ -10821,7 +10821,7 @@ int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info,
  * it while performing the free space search since we have already
  * held back allocations.
  */
-static int btrfs_trim_free_extents(struct btrfs_device *device,
+int btrfs_trim_free_extents(struct btrfs_device *device,
                                   u64 minlen, u64 *trimmed)
 {
        u64 start = 0, len = 0;