btrfs: Remove fs_info argument from btrfs_create_pending_block_groups
[sfrench/cifs-2.6.git] / fs / btrfs / extent-tree.c
index c1618ab9fecfb06a50861f26e4d445fe9d63190e..47d8992cc9fae3221e589b11192513631e97d17e 100644 (file)
@@ -3086,7 +3086,7 @@ again:
 
        if (run_all) {
                if (!list_empty(&trans->new_bgs))
-                       btrfs_create_pending_block_groups(trans, fs_info);
+                       btrfs_create_pending_block_groups(trans);
 
                spin_lock(&delayed_refs->lock);
                node = rb_first(&delayed_refs->href_root);
@@ -3686,7 +3686,7 @@ again:
         * make sure all the block groups on our dirty list actually
         * exist
         */
-       btrfs_create_pending_block_groups(trans, fs_info);
+       btrfs_create_pending_block_groups(trans);
 
        if (!path) {
                path = btrfs_alloc_path();
@@ -4706,7 +4706,7 @@ out:
         */
        if (trans->can_flush_pending_bgs &&
            trans->chunk_bytes_reserved >= (u64)SZ_2M) {
-               btrfs_create_pending_block_groups(trans, fs_info);
+               btrfs_create_pending_block_groups(trans);
                btrfs_trans_release_chunk_metadata(trans);
        }
        return ret;
@@ -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
@@ -10169,9 +10151,9 @@ error:
        return ret;
 }
 
-void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans,
-                                      struct btrfs_fs_info *fs_info)
+void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_block_group_cache *block_group, *tmp;
        struct btrfs_root *extent_root = fs_info->extent_root;
        struct btrfs_block_group_item item;