Btrfs: cleanup unnecessary clear when freeing a transaction or a trans handle
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 15 Nov 2012 08:14:11 +0000 (08:14 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 14:36:35 +0000 (09:36 -0500)
We clear the transaction object and the trans handle when they are about to be
freed, it is unnecessary, cleanup it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
fs/btrfs/transaction.c

index fc03aa60b68440862e4884f90cb88113d15610a7..a1455f1e4676ce967ee92e3a74ac0668554da585 100644 (file)
@@ -40,7 +40,6 @@ void put_transaction(struct btrfs_transaction *transaction)
        if (atomic_dec_and_test(&transaction->use_count)) {
                BUG_ON(!list_empty(&transaction->list));
                WARN_ON(transaction->delayed_refs.root.rb_node);
-               memset(transaction, 0, sizeof(*transaction));
                kmem_cache_free(btrfs_transaction_cachep, transaction);
        }
 }
@@ -650,7 +649,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
        }
        assert_qgroups_uptodate(trans);
 
-       memset(trans, 0, sizeof(*trans));
        kmem_cache_free(btrfs_trans_handle_cachep, trans);
        return err;
 }