From patchwork Wed Nov 22 00:35:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 10069065 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A1FD060375 for ; Wed, 22 Nov 2017 01:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90DBB299F0 for ; Wed, 22 Nov 2017 01:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85F1C29AB7; Wed, 22 Nov 2017 01:38:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C8D2299F0 for ; Wed, 22 Nov 2017 01:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751588AbdKVBid (ORCPT ); Tue, 21 Nov 2017 20:38:33 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:49935 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbdKVBiV (ORCPT ); Tue, 21 Nov 2017 20:38:21 -0500 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAM1cKQe023622 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Nov 2017 01:38:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAM1cK2g028091 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 22 Nov 2017 01:38:20 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAM1cKho029443 for ; Wed, 22 Nov 2017 01:38:20 GMT Received: from dhcp-10-211-47-181.usdhcp.oraclecorp.com.com (/10.211.47.181) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Nov 2017 17:38:19 -0800 From: Liu Bo To: linux-btrfs@vger.kernel.org Subject: [PATCH 4/7] Btrfs: get rbio inside fail_bio_stripe Date: Tue, 21 Nov 2017 17:35:55 -0700 Message-Id: <20171122003558.28722-5-bo.li.liu@oracle.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171122003558.28722-1-bo.li.liu@oracle.com> References: <20171122003558.28722-1-bo.li.liu@oracle.com> X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Because rbio will be bio->private in any case, we can remove @rbio in arguments. Signed-off-by: Liu Bo --- fs/btrfs/raid56.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index 24a6222..aa04e5b 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -183,7 +183,7 @@ static void rmw_work(struct btrfs_work *work); static void read_rebuild_work(struct btrfs_work *work); static void async_rmw_stripe(struct btrfs_raid_bio *rbio); static void async_read_rebuild(struct btrfs_raid_bio *rbio); -static int fail_bio_stripe(struct btrfs_raid_bio *rbio, struct bio *bio); +static int fail_bio_stripe(struct bio *bio); static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed); static void __free_raid_bio(struct btrfs_raid_bio *rbio); static void index_rbio_pages(struct btrfs_raid_bio *rbio); @@ -898,7 +898,7 @@ static void raid_write_end_io(struct bio *bio) int max_errors; if (err) - fail_bio_stripe(rbio, bio); + fail_bio_stripe(bio); bio_put(bio); @@ -1415,9 +1415,9 @@ static int fail_rbio_index(struct btrfs_raid_bio *rbio, int failed) * helper to fail a stripe based on a physical disk * bio. */ -static int fail_bio_stripe(struct btrfs_raid_bio *rbio, - struct bio *bio) +static int fail_bio_stripe(struct bio *bio) { + struct btrfs_raid_bio *rbio = bio->bi_private; int failed = find_bio_stripe(rbio, bio); if (failed < 0) @@ -1455,7 +1455,7 @@ static void raid_rmw_end_io(struct bio *bio) struct btrfs_raid_bio *rbio = bio->bi_private; if (bio->bi_status) - fail_bio_stripe(rbio, bio); + fail_bio_stripe(bio); else set_bio_pages_uptodate(bio); @@ -1998,7 +1998,7 @@ static void raid_recover_end_io(struct bio *bio) * up to date if there were no errors */ if (bio->bi_status) - fail_bio_stripe(rbio, bio); + fail_bio_stripe(bio); else set_bio_pages_uptodate(bio); bio_put(bio); @@ -2537,7 +2537,7 @@ static void raid56_parity_scrub_end_io(struct bio *bio) struct btrfs_raid_bio *rbio = bio->bi_private; if (bio->bi_status) - fail_bio_stripe(rbio, bio); + fail_bio_stripe(bio); else set_bio_pages_uptodate(bio);