public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 5/8] btrfs: stop using block_rsv_release_bytes everywhere
Date: Wed, 19 Jun 2019 13:47:21 -0400	[thread overview]
Message-ID: <20190619174724.1675-6-josef@toxicpanda.com> (raw)
In-Reply-To: <20190619174724.1675-1-josef@toxicpanda.com>

block_rsv_release_bytes() is the internal to the block_rsv code, and
shouldn't be called directly by anything else.  Switch all users to the
exported helpers.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/extent-tree.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6995edf887e1..d1fce37107b4 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4750,12 +4750,11 @@ static void btrfs_inode_rsv_release(struct btrfs_inode *inode, bool qgroup_free)
 void btrfs_delayed_refs_rsv_release(struct btrfs_fs_info *fs_info, int nr)
 {
 	struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv;
-	struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv;
 	u64 num_bytes = btrfs_calc_trans_metadata_size(fs_info, nr);
 	u64 released = 0;
 
-	released = block_rsv_release_bytes(fs_info, block_rsv, global_rsv,
-					   num_bytes, NULL);
+	released = __btrfs_block_rsv_release(fs_info, block_rsv, num_bytes,
+					     NULL);
 	if (released)
 		trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv",
 					      0, released, 0);
@@ -4840,8 +4839,7 @@ static void init_global_block_rsv(struct btrfs_fs_info *fs_info)
 
 static 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);
+	btrfs_block_rsv_release(fs_info, &fs_info->global_block_rsv, (u64)-1);
 	WARN_ON(fs_info->trans_block_rsv.size > 0);
 	WARN_ON(fs_info->trans_block_rsv.reserved > 0);
 	WARN_ON(fs_info->chunk_block_rsv.size > 0);
@@ -4890,8 +4888,8 @@ void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans)
 
 	WARN_ON_ONCE(!list_empty(&trans->new_bgs));
 
-	block_rsv_release_bytes(fs_info, &fs_info->chunk_block_rsv, NULL,
-				trans->chunk_bytes_reserved, NULL);
+	btrfs_block_rsv_release(fs_info, &fs_info->chunk_block_rsv,
+				trans->chunk_bytes_reserved);
 	trans->chunk_bytes_reserved = 0;
 }
 
@@ -7441,7 +7439,7 @@ static void unuse_block_rsv(struct btrfs_fs_info *fs_info,
 			    struct btrfs_block_rsv *block_rsv, u32 blocksize)
 {
 	btrfs_block_rsv_add_bytes(block_rsv, blocksize, false);
-	block_rsv_release_bytes(fs_info, block_rsv, NULL, 0, NULL);
+	btrfs_block_rsv_release(fs_info, block_rsv, 0);
 }
 
 /*
-- 
2.14.3


  parent reply	other threads:[~2019-06-19 17:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19 17:47 [PATCH 0/8] btrfs: move the block_rsv code out of extent-tree.c Josef Bacik
2019-06-19 17:47 ` [PATCH 1/8] btrfs: move btrfs_block_rsv definitions into it's own header Josef Bacik
2019-06-19 17:47 ` [PATCH 2/8] btrfs: export btrfs_block_rsv_add_bytes Josef Bacik
2019-06-19 17:47 ` [PATCH 3/8] btrfs: export __btrfs_block_rsv_release Josef Bacik
2019-06-19 17:47 ` [PATCH 4/8] btrfs: cleanup the target logic in __btrfs_block_rsv_release Josef Bacik
2019-06-20  8:23   ` Nikolay Borisov
2019-06-25 18:25     ` David Sterba
2019-06-19 17:47 ` Josef Bacik [this message]
2019-06-20  8:32   ` [PATCH 5/8] btrfs: stop using block_rsv_release_bytes everywhere Nikolay Borisov
2019-06-20 12:39     ` Josef Bacik
2019-06-19 17:47 ` [PATCH 6/8] btrfs: migrate the block-rsv code to block-rsv.c Josef Bacik
2019-06-19 17:47 ` [PATCH 7/8] btrfs: migrate the global_block_rsv helpers " Josef Bacik
2019-06-19 17:47 ` [PATCH 8/8] btrfs: export and migrate use_block_rsv/unuse_block_rsv Josef Bacik
2019-07-01 15:19 ` [PATCH 0/8] btrfs: move the block_rsv code out of extent-tree.c David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190619174724.1675-6-josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox