From patchwork Mon Sep 24 00:46:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Sheng-Hui X-Patchwork-Id: 1495991 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 609D2DFFD0 for ; Mon, 24 Sep 2012 00:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754699Ab2IXArA (ORCPT ); Sun, 23 Sep 2012 20:47:00 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44276 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754667Ab2IXArA (ORCPT ); Sun, 23 Sep 2012 20:47:00 -0400 Received: by pbbrr4 with SMTP id rr4so6141595pbb.19 for ; Sun, 23 Sep 2012 17:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=vR4b7Q/qo1+FL9DhJ3qFAfA4k/ZirW2P7Ph9gl2QCZ0=; b=JV638o5sKzGhdVWYe1hd0HPPcDcwOaArwGx6rKKZJG6b0wLj9rWdeIVYANJuT/+9PI 6d9527etEnOJ24K57vbuo/p+c+f4sq/NEX4Nxw31UOVnnfS1ibOhg5mkCmTvnVGrilLW rRaMmP47BnJ612WVdjnwP9IMpViZJWSrgxSCEcxigUw8Ku5lteHiKaJ5fciB5c9NtVph +Tq6hzM6XAmrH1Lq686nNQXXDxJrUc8Sfk9EFDw0Mq0MQhnPviN5I79Yo3D1SUhiVyy/ i8OF05/byMFha0Aax1Zgk6R8s4N89K8nfEMoTFgPFyW6rJQWc5csqLAlMpz2GgCCkGed tfeA== Received: by 10.66.75.232 with SMTP id f8mr28607487paw.59.1348447619679; Sun, 23 Sep 2012 17:46:59 -0700 (PDT) Received: from [9.115.120.40] ([202.108.130.138]) by mx.google.com with ESMTPS id h8sm7825845pay.0.2012.09.23.17.46.56 (version=SSLv3 cipher=OTHER); Sun, 23 Sep 2012 17:46:58 -0700 (PDT) Message-ID: <505FAD76.8030502@gmail.com> Date: Mon, 24 Sep 2012 08:46:46 +0800 From: Wang Sheng-Hui User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: linux-btrfs@vger.kernel.org, trivial@kernel.org Subject: [PATCH 1/4] Btrfs: cleanup: return the ret value of __btrfs_end_transaction directly in btrfs_end_transaction_ Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org No need to use specific var to record the return value of __btrfs_end_transaction and check if it is not zero. Just return the result directly as btrfs_end_transaction_dmeta. Signed-off-by: Wang Sheng-Hui --- fs/btrfs/transaction.c | 21 +++------------------ 1 files changed, 3 insertions(+), 18 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 27c2600..8fcc501 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -602,34 +602,19 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, int btrfs_end_transaction(struct btrfs_trans_handle *trans, struct btrfs_root *root) { - int ret; - - ret = __btrfs_end_transaction(trans, root, 0, 1); - if (ret) - return ret; - return 0; + return __btrfs_end_transaction(trans, root, 0, 1); } int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans, struct btrfs_root *root) { - int ret; - - ret = __btrfs_end_transaction(trans, root, 1, 1); - if (ret) - return ret; - return 0; + return __btrfs_end_transaction(trans, root, 1, 1); } int btrfs_end_transaction_nolock(struct btrfs_trans_handle *trans, struct btrfs_root *root) { - int ret; - - ret = __btrfs_end_transaction(trans, root, 0, 0); - if (ret) - return ret; - return 0; + return __btrfs_end_transaction(trans, root, 0, 0); } int btrfs_end_transaction_dmeta(struct btrfs_trans_handle *trans,