From patchwork Mon Jul 18 12:19:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wanlong Gao X-Patchwork-Id: 985992 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ICMARe017038 for ; Mon, 18 Jul 2011 12:22:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752479Ab1GRMVx (ORCPT ); Mon, 18 Jul 2011 08:21:53 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:54229 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957Ab1GRMVw (ORCPT ); Mon, 18 Jul 2011 08:21:52 -0400 Received: by iyb12 with SMTP id 12so3038397iyb.19 for ; Mon, 18 Jul 2011 05:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=6oLeKnzLmrLaNh7/gg19beInujVVP6ArFAyLUiEOnUw=; b=G/FKt7DjVQV4F9mSPmomoj2f5WWiAbRl4QXLLZAkoRg+Z2M9LGOiVt7kJRSvEhf7QC WgKyeYnhOJoC1i5pEiCMI/MCB7PRPH/coFSNGp/3LN0Cv+xF3m/8UWn5n60LLt7HQ3vw eyFJxK6i0uzSYLSV7gqODS1ftZmKhYw7F0qto= Received: by 10.42.169.7 with SMTP id z7mr5247764icy.514.1310991711569; Mon, 18 Jul 2011 05:21:51 -0700 (PDT) Received: from localhost.localdomain ([58.240.156.98]) by mx.google.com with ESMTPS id b6sm2900113ibg.65.2011.07.18.05.21.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jul 2011 05:21:50 -0700 (PDT) From: Wanlong Gao To: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chris Mason , Wanlong Gao , Wanlong Gao Subject: [PATCH] Btrfs:don't check the return value of __btrfs_add_inode_defrag Date: Mon, 18 Jul 2011 20:19:35 +0800 Message-Id: <1310991575-7528-1-git-send-email-wanlong.gao@gmail.com> X-Mailer: git-send-email 1.7.4.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 18 Jul 2011 12:22:11 +0000 (UTC) Don't need to check the return value of __btrfs_add_inode_defrag(), since it will always return 0. Signed-off-by: Wanlong Gao --- fs/btrfs/file.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fa4ef18..4a6d190 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -74,7 +74,7 @@ struct inode_defrag { * If an existing record is found the defrag item you * pass in is freed */ -static int __btrfs_add_inode_defrag(struct inode *inode, +static void __btrfs_add_inode_defrag(struct inode *inode, struct inode_defrag *defrag) { struct btrfs_root *root = BTRFS_I(inode)->root; @@ -106,11 +106,11 @@ static int __btrfs_add_inode_defrag(struct inode *inode, BTRFS_I(inode)->in_defrag = 1; rb_link_node(&defrag->rb_node, parent, p); rb_insert_color(&defrag->rb_node, &root->fs_info->defrag_inodes); - return 0; + return; exists: kfree(defrag); - return 0; + return; } @@ -123,7 +123,6 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, { struct btrfs_root *root = BTRFS_I(inode)->root; struct inode_defrag *defrag; - int ret = 0; u64 transid; if (!btrfs_test_opt(root, AUTO_DEFRAG)) @@ -150,9 +149,9 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, spin_lock(&root->fs_info->defrag_inodes_lock); if (!BTRFS_I(inode)->in_defrag) - ret = __btrfs_add_inode_defrag(inode, defrag); + __btrfs_add_inode_defrag(inode, defrag); spin_unlock(&root->fs_info->defrag_inodes_lock); - return ret; + return 0; } /*