Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b5a1c53 authored by Miao Xie's avatar Miao Xie Committed by Josef Bacik
Browse files

Btrfs: cleanup unnecessary clear when freeing a transaction or a trans handle



We clear the transaction object and the trans handle when they are about to be
freed, it is unnecessary, cleanup it.

Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
parent 78a6184a
Loading
Loading
Loading
Loading
+0 −2
Original line number Original line Diff line number Diff line
@@ -40,7 +40,6 @@ void put_transaction(struct btrfs_transaction *transaction)
	if (atomic_dec_and_test(&transaction->use_count)) {
	if (atomic_dec_and_test(&transaction->use_count)) {
		BUG_ON(!list_empty(&transaction->list));
		BUG_ON(!list_empty(&transaction->list));
		WARN_ON(transaction->delayed_refs.root.rb_node);
		WARN_ON(transaction->delayed_refs.root.rb_node);
		memset(transaction, 0, sizeof(*transaction));
		kmem_cache_free(btrfs_transaction_cachep, 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);
	assert_qgroups_uptodate(trans);


	memset(trans, 0, sizeof(*trans));
	kmem_cache_free(btrfs_trans_handle_cachep, trans);
	kmem_cache_free(btrfs_trans_handle_cachep, trans);
	return err;
	return err;
}
}