[2/8] btrfs: export btrfs_block_rsv_add_bytes
diff mbox series

Message ID 20190619174724.1675-3-josef@toxicpanda.com
State New
Headers show
Series
  • btrfs: move the block_rsv code out of extent-tree.c
Related show

Commit Message

Josef Bacik June 19, 2019, 5:47 p.m. UTC
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>
---
 fs/btrfs/block-rsv.h   |  2 ++
 fs/btrfs/extent-tree.c | 18 +++++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

Patch
diff mbox series

diff --git a/fs/btrfs/block-rsv.h b/fs/btrfs/block-rsv.h
index 13f5ab02a635..1ddc0659c678 100644
--- a/fs/btrfs/block-rsv.h
+++ b/fs/btrfs/block-rsv.h
@@ -78,4 +78,6 @@  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 */
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2e128ecc95f7..2c81c546f0fc 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4385,8 +4385,8 @@  int btrfs_block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv,
 	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;
@@ -4418,7 +4418,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;
 }
 
@@ -4501,7 +4501,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;
@@ -4573,7 +4573,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;
 }
 
@@ -4626,7 +4626,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;
 }
@@ -4671,7 +4671,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;
 	}
 
@@ -5062,7 +5062,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);
 
@@ -7439,7 +7439,7 @@  use_block_rsv(struct btrfs_trans_handle *trans,
 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);
 }