diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-02-07 16:55:37 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 15:09:30 +0200 |
commit | 0e34693f7bb149273b747194b3988801a9ca8c8e (patch) | |
tree | b58a6a849006e79d6db53ea6b011babb45b92415 /fs/btrfs/transaction.c | |
parent | btrfs: open code btrfs_init_dev_replace_tgtdev_for_resume() (diff) | |
download | linux-0e34693f7bb149273b747194b3988801a9ca8c8e.tar.xz linux-0e34693f7bb149273b747194b3988801a9ca8c8e.zip |
btrfs: Make btrfs_trans_release_metadata private to transaction.c
This function is only ever used in __btrfs_end_transaction and
btrfs_commit_transaction so there is no need to export it via header.
Let's move it closer to where it's used, make it static and remove it
from the header. No functional changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2141587195d4..beca25635787 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -818,6 +818,25 @@ int btrfs_should_end_transaction(struct btrfs_trans_handle *trans) return should_end_transaction(trans); } +static void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, + struct btrfs_fs_info *fs_info) +{ + if (!trans->block_rsv) { + ASSERT(!trans->bytes_reserved); + return; + } + + if (!trans->bytes_reserved) + return; + + ASSERT(trans->block_rsv == &fs_info->trans_block_rsv); + trace_btrfs_space_reservation(fs_info, "transaction", + trans->transid, trans->bytes_reserved, 0); + btrfs_block_rsv_release(fs_info, trans->block_rsv, + trans->bytes_reserved); + trans->bytes_reserved = 0; +} + static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, int throttle) { |