btrfs: Make btrfs_trans_release_metadata private to transaction.c
authorNikolay Borisov <nborisov@suse.com>
Wed, 7 Feb 2018 15:55:37 +0000 (17:55 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:30 +0000 (15:09 +0200)
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>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c

index da308774b8a4538c4bbea595a11b49a2a8c5ca5e..f7ab01fa5315dbcb32409ca50eb4eb40b4a6dc07 100644 (file)
@@ -2733,8 +2733,6 @@ void btrfs_delalloc_release_space(struct inode *inode,
                        struct extent_changeset *reserved, u64 start, u64 len);
 void btrfs_free_reserved_data_space_noquota(struct inode *inode, u64 start,
                                            u64 len);
-void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
-                                 struct btrfs_fs_info *fs_info);
 void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans);
 int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans,
                                  struct btrfs_inode *inode);
index c1618ab9fecfb06a50861f26e4d445fe9d63190e..8f772fec9d6d1d7dc25eea255956189c915d7d28 100644 (file)
@@ -5893,24 +5893,6 @@ static void release_global_block_rsv(struct btrfs_fs_info *fs_info)
        WARN_ON(fs_info->delayed_block_rsv.reserved > 0);
 }
 
-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;
-}
 
 /*
  * To be called after all the new block groups attached to the transaction
index 2141587195d46a46db285ca35fc1536dcfe8ab34..beca2563578722615afeb3a7e287fd4c0b9b969a 100644 (file)
@@ -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)
 {