From patchwork Thu Nov 15 08:14:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 1747431 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8D97ADFFEC for ; Thu, 15 Nov 2012 08:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752089Ab2KOIN4 (ORCPT ); Thu, 15 Nov 2012 03:13:56 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:48784 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750760Ab2KOINz (ORCPT ); Thu, 15 Nov 2012 03:13:55 -0500 X-IronPort-AV: E=Sophos;i="4.83,255,1352044800"; d="scan'208";a="6205246" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 15 Nov 2012 16:12:14 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id qAF8Dqh2018274 for ; Thu, 15 Nov 2012 16:13:52 +0800 Received: from [10.167.225.199] ([10.167.225.199]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012111516134714-1180425 ; Thu, 15 Nov 2012 16:13:47 +0800 Message-ID: <50A4A453.3050901@cn.fujitsu.com> Date: Thu, 15 Nov 2012 16:14:11 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121029 Thunderbird/16.0.2 MIME-Version: 1.0 To: Linux Btrfs Subject: [PATCH 1/2] Btrfs: cleanup unnecessary clear when freeing a transaction or a trans handle X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/11/15 16:13:47, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/11/15 16:13:47, Serialize complete at 2012/11/15 16:13:47 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 --- fs/btrfs/transaction.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index d9a9a70..9930888 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -39,7 +39,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); } } @@ -644,7 +643,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; }