From patchwork Fri May 25 03:46:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10426107 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 ABF9E602D8 for ; Fri, 25 May 2018 03:50:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C2032959E for ; Fri, 25 May 2018 03:50:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90B8C295A5; Fri, 25 May 2018 03:50:58 +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=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0267E2959E for ; Fri, 25 May 2018 03:50:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 174CA6B02B6; Thu, 24 May 2018 23:50:57 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0FED16B02B8; Thu, 24 May 2018 23:50:57 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE4426B02B9; Thu, 24 May 2018 23:50:56 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id C32D26B02B6 for ; Thu, 24 May 2018 23:50:56 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id m65-v6so2890874qkh.11 for ; Thu, 24 May 2018 20:50:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=/Oe/5KkQ+wx5T/igQKPOyloG7ltZmmSvw1Ui9CPSRg8=; b=YVfY2O6ypCfwcngGUHwtSf7Pqh++ZA8FuHKiHq09bgYISDCBLwvIhpCgXvNWDnpy6h KiTKTcGh20qPsXOSn2gkfoBpmNekx+GopMqQqcdAyTDMEIj2+DkCBEvtKuOeSNFPbk3Q 1ctvK2s3CV73JSNZeiYtGDb/LKsUb6u5FkjD2WrdOlw36mFGf7wzYAW7sPWPeDyGMef6 oXYE0da7U/sGHUdQTZ0nrpy/jAClxd9Gx3FyyMNPBpHVQ+fdTKOqiGkt11K2R7jU7PbY Ta0KlZiKoo2mpypm1X7sMi66AR3ExdiUOen1oOcvTPoiI+X1KIaUVSgCyTeo+aggJFct dFJw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: ALKqPweM1A95CuHwwQEOXgjKfuxwrLVFlLC9OR14z9MPsUoxX4S6+ND9 MfoA4e9vzn15e6bZUt4LCcZL+G7wmD81ZmRKxrwBY6gQ1AsNkRG3NGM1t0+WI3b3tMLQ558rRmw +gT1QgM1+N/QX3T1YFeTmfwWteVz70jLgdDRhX+tMEZTQxUuFoL39ata0t0zCB7g/Wg== X-Received: by 2002:ae9:ef53:: with SMTP id d80-v6mr587170qkg.336.1527220256572; Thu, 24 May 2018 20:50:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLzoMKarHfpG2Zi2Vt6uF5060l3CBjxRnpEej2NddZBIvZtspT3EnC1Dw+W6Snu17j6VKAm X-Received: by 2002:ae9:ef53:: with SMTP id d80-v6mr587143qkg.336.1527220255896; Thu, 24 May 2018 20:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220255; cv=none; d=google.com; s=arc-20160816; b=HeI7QxbNgta/70NnYm7iSKaSlz39XFqsFaOb5IWgXqExx5HzC5bHKVPXU5IGJQ7A8v TvJdHTp9dIEwUrapmyFqnHL2Mb2ZQe8WTMb3QX0PBwc8odxb2H7diDNAkd+Wl2PVzYr+ PVO2+0X0O0XxIKsemjr3YDTc2piikY9Bw+LD8fZExmyXk4i+qig4oHBOFytsZ2qXK4qa dMNkdhmIQstclHVPySs9+jfYXCAuGR6oozVXdRQ6gx44j/FDMRpQNar1fJX/RRLVCXeO MHpWXIpMNowENvtXKdsF3K9B/aQIiZK0trgepmBkg+IAqW0LWZqUwG1N4JLGzgi/bN0s vjSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=/Oe/5KkQ+wx5T/igQKPOyloG7ltZmmSvw1Ui9CPSRg8=; b=P0YjMf/Zurzjpaal2MT+Hexq93BrBCl2bEfr5HuftDMY6RTMMvNwJxrekHcYCrg8ps +aUyH5B6B87P5ibVoXNc1CQOsFhSbbk0MVQUfzzPAhofNTMSUdhbTbYacm6JNGfegXwR 7bQ+m0SrxkHsMqfBoeoVgCdPPHZ3Z/+DvDyS6fr9DRqrbKrWHjaQDe6ofEOARK+sMljc 86oRNWppMPaf0LCndIjKV/odKem7m0werdhFCZLiWMu+/CXFRhWZPNyilLJ2Zwpp6PuP wQ5QvDbpZkyMxN2U6tSo5ihDXPzthjN2yp9eFZV2z/LZoYtUL+gnkyE7risVtNkLBVb3 aqGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id w5-v6si10762310qve.271.2018.05.24.20.50.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 20:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) client-ip=66.187.233.73; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ming.lei@redhat.com designates 66.187.233.73 as permitted sender) smtp.mailfrom=ming.lei@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7365ABB41B; Fri, 25 May 2018 03:50:55 +0000 (UTC) Received: from localhost (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56C992166BB2; Fri, 25 May 2018 03:50:48 +0000 (UTC) From: Ming Lei To: Jens Axboe , Christoph Hellwig , Alexander Viro , Kent Overstreet Cc: David Sterba , Huang Ying , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Theodore Ts'o , "Darrick J . Wong" , Coly Li , Filipe Manana , Ming Lei Subject: [RESEND PATCH V5 22/33] btrfs: conver to bio_for_each_page_all2 Date: Fri, 25 May 2018 11:46:10 +0800 Message-Id: <20180525034621.31147-23-ming.lei@redhat.com> In-Reply-To: <20180525034621.31147-1-ming.lei@redhat.com> References: <20180525034621.31147-1-ming.lei@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 25 May 2018 03:50:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Fri, 25 May 2018 03:50:55 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP bio_for_each_page_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_page_all2(). Signed-off-by: Ming Lei --- fs/btrfs/compression.c | 3 ++- fs/btrfs/disk-io.c | 3 ++- fs/btrfs/extent_io.c | 9 ++++++--- fs/btrfs/inode.c | 6 ++++-- fs/btrfs/raid56.c | 3 ++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index be6b09dfd6a7..4cfe38feae3b 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -166,13 +166,14 @@ static void end_compressed_bio_read(struct bio *bio) } else { int i; struct bio_vec *bvec; + struct bvec_iter_all bia; /* * we have verified the checksum already, set page * checked so the end_io handlers know about it */ ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, cb->orig_bio, i) + bio_for_each_page_all2(bvec, cb->orig_bio, i, bia) SetPageChecked(bvec->bv_page); bio_endio(cb->orig_bio); diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c6dc8a636413..ef78fd71c2f7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -829,9 +829,10 @@ static blk_status_t btree_csum_one_bio(struct bio *bio) struct bio_vec *bvec; struct btrfs_root *root; int i, ret = 0; + struct bvec_iter_all bia; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) { + bio_for_each_page_all2(bvec, bio, i, bia) { root = BTRFS_I(bvec->bv_page->mapping->host)->root; ret = csum_dirty_buffer(root->fs_info, bvec->bv_page); if (ret) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3c9c91a1e3e9..383db7a7e5a4 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2456,9 +2456,10 @@ static void end_bio_extent_writepage(struct bio *bio) u64 start; u64 end; int i; + struct bvec_iter_all bia; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) { + bio_for_each_page_all2(bvec, bio, i, bia) { struct page *page = bvec->bv_page; struct inode *inode = page->mapping->host; struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); @@ -2527,9 +2528,10 @@ static void end_bio_extent_readpage(struct bio *bio) int mirror; int ret; int i; + struct bvec_iter_all bia; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) { + bio_for_each_page_all2(bvec, bio, i, bia) { struct page *page = bvec->bv_page; struct inode *inode = page->mapping->host; struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); @@ -3681,9 +3683,10 @@ static void end_bio_extent_buffer_writepage(struct bio *bio) struct bio_vec *bvec; struct extent_buffer *eb; int i, done; + struct bvec_iter_all bia; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) { + bio_for_each_page_all2(bvec, bio, i, bia) { struct page *page = bvec->bv_page; eb = (struct extent_buffer *)page->private; diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9d816dc725c4..8a73b26915bc 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7883,6 +7883,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio) struct bio_vec *bvec; struct extent_io_tree *io_tree, *failure_tree; int i; + struct bvec_iter_all bia; if (bio->bi_status) goto end; @@ -7894,7 +7895,7 @@ static void btrfs_retry_endio_nocsum(struct bio *bio) done->uptodate = 1; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) + bio_for_each_page_all2(bvec, bio, i, bia) clean_io_failure(BTRFS_I(inode)->root->fs_info, failure_tree, io_tree, done->start, bvec->bv_page, btrfs_ino(BTRFS_I(inode)), 0); @@ -7973,6 +7974,7 @@ static void btrfs_retry_endio(struct bio *bio) int uptodate; int ret; int i; + struct bvec_iter_all bia; if (bio->bi_status) goto end; @@ -7986,7 +7988,7 @@ static void btrfs_retry_endio(struct bio *bio) failure_tree = &BTRFS_I(inode)->io_failure_tree; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) { + bio_for_each_page_all2(bvec, bio, i, bia) { ret = __readpage_endio_check(inode, io_bio, i, bvec->bv_page, bvec->bv_offset, done->start, bvec->bv_len); diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c index ab9d80f79ffe..955fa4dbecee 100644 --- a/fs/btrfs/raid56.c +++ b/fs/btrfs/raid56.c @@ -1445,10 +1445,11 @@ static void set_bio_pages_uptodate(struct bio *bio) { struct bio_vec *bvec; int i; + struct bvec_iter_all bia; ASSERT(!bio_flagged(bio, BIO_CLONED)); - bio_for_each_page_all(bvec, bio, i) + bio_for_each_page_all2(bvec, bio, i, bia) SetPageUptodate(bvec->bv_page); }