From patchwork Fri Sep 2 19:40:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 9311573 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 EC36160772 for ; Fri, 2 Sep 2016 19:41:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9AC429835 for ; Fri, 2 Sep 2016 19:41:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCD7C2984D; Fri, 2 Sep 2016 19:41:03 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 39CFA29835 for ; Fri, 2 Sep 2016 19:41:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932340AbcIBTlA (ORCPT ); Fri, 2 Sep 2016 15:41:00 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:55951 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178AbcIBTk7 (ORCPT ); Fri, 2 Sep 2016 15:40:59 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u82JXSqT003058 for ; Fri, 2 Sep 2016 12:40:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=MAuBCS011aIEZlvK3p/KhjDJ+Ac0cKFktxAxrWLcazQ=; b=jqFsiU1lgSxHwiBsSFrv5wZ9SxNdKfm+QffJO1u+8gpX8JuPAu6gJiq856/wGtvlHO3p Ypt3oUPw45Q5kl5/EuiZL1UnfsRNkgik9rDl/K3dcfry5TBD1y1aRp3g+jH+0kbM0x5U WJ1UoKJ8JyHIX649ImqU5FFnUH37Jj6KmtM= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 257dbc0ych-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 02 Sep 2016 12:40:58 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.26) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 2 Sep 2016 15:40:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=QtyqIGYlwRIJMBnN7Dh7uOK6hz/iH1mpKwlMAEp7xkA=; b=Kh/8h7kvL0IQ6pWDoV70+Mg4rfJYZxjiWXwKDJTxEUSp7RLt4/jpEWd3wOMOHg4UNHY9Z/bLItytDfKBDlB+SGl+cccyLdg30SGEWUovT136MJ7mDgsGG6jyZjdh1HyZX1yOvCgrv8126jlOClV7H+xdCNcnH4fh/lux/2MkF8E= Received: from localhost (107.15.72.49) by DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Fri, 2 Sep 2016 19:40:55 +0000 From: Josef Bacik To: , Subject: [PATCH 2/7] btrfs: remove inode argument from repair_io_failure Date: Fri, 2 Sep 2016 15:40:01 -0400 Message-ID: <1472845206-22870-3-git-send-email-jbacik@fb.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472845206-22870-1-git-send-email-jbacik@fb.com> References: <1472845206-22870-1-git-send-email-jbacik@fb.com> MIME-Version: 1.0 X-Originating-IP: [107.15.72.49] X-ClientProxiedBy: DM2PR0501CA0004.namprd05.prod.outlook.com (10.162.29.142) To DM5PR15MB1321.namprd15.prod.outlook.com (10.173.210.11) X-MS-Office365-Filtering-Correlation-Id: e30ab0d4-fbcb-42fd-0be2-08d3d3690e4d X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 2:zLUv2uC53qL8X1ugkt+nQPh03mm4viUbJkWIdwkV+ONKqYDCmYKXvVyo7MytlppNcbGQAdDXYI8C/kwzKxoQDU1u7dBjZ6KvuAfGp600wIFDRL82HBaN2J3/fCmxwHYKzoa5HnHjve/Wwd2nB+r+l5Smo3iLEZ2/3YhBJj1wM9JpqwXZa4RJ1yy9onNa1feX; 3:Ut0OWtvivZbX4fBJ/Nmxjh25kWZ7eKoDVUtfRkXd9BGpWlvvrTJUCb53K/I4NjNsUrW/bN3C4Tt6P79CvGqqy5RjxIkH8Kg+iuRaCdfg+pBMxzSwtUo4GHcC2WFCaX96 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM5PR15MB1321; X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 25:ZPCT7EcIO/40zkEIUpobXX0DtbWK2lQAYWyYQQeTDqaQdqUYpoGZfFgJTE+eim4aZtCplgr394zgCJQCsPkcavpRjrESo8kdg2Vxg2MZPelloM+s8HvVaY3a13HvxePyggUibtg+y/UW/qJsMCxjWyeSYRV0TlCwTZYD5rJCVs3QenOIsmIozw0tWgQDEMJ+ittYTXEIUvPuxtE6NMEQj12lwh0k0+ghONdDFSEdMUDDIn/kuclRh3UQAzvqdWNksTPPucx5ygXinUmZoZBOo/KJQBC69C/d7D5wFLgosT+MJx5RY+IGjUomK19UBsl/fDyxqj4AQFkX76N3/BSI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TOBPnRyhTrN1p5Ro9a7wLLcFrk8dwBVwlA+4AuRifm8NZ8xRvF8j2fn64bfTASRnwrT2OWAfqcy/qOaNSUAlfAQ5sOeOqJKbO7FAQYyGqFM7F9z51OUaAAt2BgV8+wc8wyF0bQdwFFmvq6J3e0pWG2Ktntcy0m0FyVV5khvEw5qjJstYbUs6820I9UsMcgUy6cbPhKU4bUX0fm1VdcsfrTzAGGtX5i+PqzUEp1yRMuCafQp5tCZdFacbvE4c+SjYsfZo3dBO9qwT9CKzdYGnpJLywK+p3YqKb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046); SRVR:DM5PR15MB1321; BCL:0; PCL:0; RULEID:; SRVR:DM5PR15MB1321; X-Forefront-PRVS: 00531FAC2C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(979002)(6069001)(6009001)(7916002)(199003)(189002)(66066001)(19580405001)(92566002)(305945005)(19580395003)(105586002)(81166006)(48376002)(5003940100001)(450100001)(97736004)(50466002)(77096005)(7846002)(7736002)(229853001)(106356001)(5001770100001)(81156014)(2906002)(50226002)(76506005)(36756003)(586003)(8676002)(42186005)(3846002)(189998001)(86362001)(68736007)(6116002)(2950100001)(76176999)(5660300001)(50986999)(101416001)(33646002)(47776003)(107886002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR15MB1321; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR15MB1321; 23:9s8AsMV1L9LyQBcwhCAClB9lhKgNZbWmGr+6Mxwan?= =?us-ascii?Q?DHrEH+uiBMWFwEHSj56a/W/u6NMIYQd3NzyNN/q+h7xw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SaGB0s8+CHYBLicRE2fQQrXrs/7jg3T+taaSUbVMv2MnRXYCuD+aLkWiHh/pAn8zpTQ1f0YChC4oWPozV2rnkYSq8AubAJSS16LbU+pWnpEXKIz7D/eHTu0YlK7b+tYllp5f2PrANEb3kw6KsoFzQX113L0t/8j0P+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR15MB1321; 20:eFI+wFnRy9hSMGjmp+iYqZ8WNYQAAR0ZO1Rzg6TGazpJS0tW9QyVhk9ZIH67Li9esduT/UM39Gz67TNI/nCvoHtx9jyEJLfi+yf1teLwwl3eqjYySaSyN9YyzmJOo9vwlJRVXuhf5+4cVhurc75NYtRCwRaDi8OcWd8mOkq305Y= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Sep 2016 19:40:55.3198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR15MB1321 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-09-02_06:, , signatures=0 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 Once we remove the btree_inode we won't have an inode to pass anymore, just pass the fs_info directly and the inum since we use that to print out the repair message. Signed-off-by: Josef Bacik --- fs/btrfs/extent_io.c | 14 +++++++------- fs/btrfs/extent_io.h | 6 +++--- fs/btrfs/scrub.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 515b78a..3132f1a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1979,10 +1979,10 @@ int free_io_failure(struct inode *inode, struct io_failure_record *rec) * currently, there can be no more than two copies of every data bit. thus, * exactly one rewrite is required. */ -int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical, - struct page *page, unsigned int pg_offset, int mirror_num) +int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start, + u64 length, u64 logical, struct page *page, + unsigned int pg_offset, int mirror_num) { - struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; struct bio *bio; struct btrfs_device *dev; u64 map_length = 0; @@ -2041,7 +2041,7 @@ int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical, btrfs_info_rl_in_rcu(fs_info, "read error corrected: ino %llu off %llu (dev %s sector %llu)", - btrfs_ino(inode), start, + ino, start, rcu_str_deref(dev->name), sector); btrfs_bio_counter_dec(fs_info); bio_put(bio); @@ -2061,7 +2061,7 @@ int repair_eb_io_failure(struct btrfs_root *root, struct extent_buffer *eb, for (i = 0; i < num_pages; i++) { struct page *p = eb->pages[i]; - ret = repair_io_failure(root->fs_info->btree_inode, start, + ret = repair_io_failure(root->fs_info, 0, start, PAGE_SIZE, start, p, start - page_offset(p), mirror_num); if (ret) @@ -2119,8 +2119,8 @@ int clean_io_failure(struct inode *inode, u64 start, struct page *page, num_copies = btrfs_num_copies(fs_info, failrec->logical, failrec->len); if (num_copies > 1) { - repair_io_failure(inode, start, failrec->len, - failrec->logical, page, + repair_io_failure(fs_info, btrfs_ino(inode), start, + failrec->len, failrec->logical, page, pg_offset, failrec->failed_mirror); } } diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index c3dd064..61adf16 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -426,9 +426,9 @@ struct bio *btrfs_bio_clone(struct bio *bio, gfp_t gfp_mask); struct btrfs_fs_info; -int repair_io_failure(struct inode *inode, u64 start, u64 length, u64 logical, - struct page *page, unsigned int pg_offset, - int mirror_num); +int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start, + u64 length, u64 logical, struct page *page, + unsigned int pg_offset, int mirror_num); int clean_io_failure(struct inode *inode, u64 start, struct page *page, unsigned int pg_offset); void end_extent_writepage(struct page *page, int err, u64 start, u64 end); diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 1d195d2..4624283 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -732,7 +732,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx) ret = -EIO; goto out; } - ret = repair_io_failure(inode, offset, PAGE_SIZE, + ret = repair_io_failure(fs_info, inum, offset, PAGE_SIZE, fixup->logical, page, offset - page_offset(page), fixup->mirror_num);