btrfs: export btrfs_block_rsv_add_bytes
authorJosef Bacik <josef@toxicpanda.com>
Wed, 19 Jun 2019 17:47:18 +0000 (13:47 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:54 +0000 (12:30 +0200)
This is used in a few places, we need to make sure it's exported so we
can move it around.

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

index 359e73d329e761d51ded17ad72b2a6a58b910fc5..f4af1c0766a78f8fac85f826388f96371c55ef4a 100644 (file)
@@ -73,5 +73,7 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
 void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
                             struct btrfs_block_rsv *block_rsv,
                             u64 num_bytes);
+void btrfs_block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
+                              u64 num_bytes, bool update_size);
 
 #endif /* BTRFS_BLOCK_RSV_H */
index 3f2ccfed3b0e502c5daa302b179d2d04ae8d170f..2f6e74803c9fae7aafd86f58627b4306c1bdf016 100644 (file)
@@ -4382,8 +4382,8 @@ int btrfs_block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv, u64 num_bytes)
        return ret;
 }
 
-static void block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
-                               u64 num_bytes, bool update_size)
+void btrfs_block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
+                              u64 num_bytes, bool update_size)
 {
        spin_lock(&block_rsv->lock);
        block_rsv->reserved += num_bytes;
@@ -4415,7 +4415,7 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
                global_rsv->full = 0;
        spin_unlock(&global_rsv->lock);
 
-       block_rsv_add_bytes(dest, num_bytes, true);
+       btrfs_block_rsv_add_bytes(dest, num_bytes, true);
        return 0;
 }
 
@@ -4497,7 +4497,7 @@ int btrfs_delayed_refs_rsv_refill(struct btrfs_fs_info *fs_info,
                                           num_bytes, flush);
        if (ret)
                return ret;
-       block_rsv_add_bytes(block_rsv, num_bytes, 0);
+       btrfs_block_rsv_add_bytes(block_rsv, num_bytes, 0);
        trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
                                      0, num_bytes, 1);
        return 0;
@@ -4569,7 +4569,7 @@ int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src,
        if (ret)
                return ret;
 
-       block_rsv_add_bytes(dst, num_bytes, update_size);
+       btrfs_block_rsv_add_bytes(dst, num_bytes, update_size);
        return 0;
 }
 
@@ -4622,7 +4622,7 @@ int btrfs_block_rsv_add(struct btrfs_root *root,
 
        ret = btrfs_reserve_metadata_bytes(root, block_rsv, num_bytes, flush);
        if (!ret)
-               block_rsv_add_bytes(block_rsv, num_bytes, true);
+               btrfs_block_rsv_add_bytes(block_rsv, num_bytes, true);
 
        return ret;
 }
@@ -4667,7 +4667,7 @@ int btrfs_block_rsv_refill(struct btrfs_root *root,
 
        ret = btrfs_reserve_metadata_bytes(root, block_rsv, num_bytes, flush);
        if (!ret) {
-               block_rsv_add_bytes(block_rsv, num_bytes, false);
+               btrfs_block_rsv_add_bytes(block_rsv, num_bytes, false);
                return 0;
        }
 
@@ -5057,7 +5057,7 @@ int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes)
        spin_unlock(&inode->lock);
 
        /* Now we can safely add our space to our block rsv */
-       block_rsv_add_bytes(block_rsv, meta_reserve, false);
+       btrfs_block_rsv_add_bytes(block_rsv, meta_reserve, false);
        trace_btrfs_space_reservation(root->fs_info, "delalloc",
                                      btrfs_ino(inode), meta_reserve, 1);
 
@@ -7429,7 +7429,7 @@ try_reserve:
 static 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);
+       btrfs_block_rsv_add_bytes(block_rsv, blocksize, false);
        block_rsv_release_bytes(fs_info, block_rsv, NULL, 0, NULL);
 }