Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2999826imm; Thu, 24 May 2018 20:52:41 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpMUbK63b3UHD7RJfXrFh1lgh5lgEaeuKev/LOw1pe+ej+RRt57PLGh+8W68mEw+l/A4gZ+ X-Received: by 2002:a63:2a89:: with SMTP id q131-v6mr605025pgq.379.1527220361712; Thu, 24 May 2018 20:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220361; cv=none; d=google.com; s=arc-20160816; b=SZKF2VdwUXaZ4rokm8rpk/Tt5fD9O6YBrYuF4oZYlqCp2js/eXwyZed3ET/1HjRPt0 J7AqMmcxcB8d9vkndZp0aSOvH/vyc0n+hDjkB9YmJZ9PZiEEgTNNBza2iSXtvd/UNW/3 ZfWz7w7FnNzV2vRVLfuhWP8/7KZlv6Xf2c+QB8nrEPOEqevjwvS8BdxWe2kQU4Qpla6b FziYMlveO6oDFIGQz9aL7DQb339EkCrUl04NVB2BCSkDI9gY/yFeYiBk6KSujWaiAsjM YWa2cMqxxpYhm6AUzw+zCYiNlffa+RNW3I8GjL7zdQhLxr5VRAh9hB43uZPiqGJcHtTj f08A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=/Oe/5KkQ+wx5T/igQKPOyloG7ltZmmSvw1Ui9CPSRg8=; b=a8Wqe/ciQGcZDqoTNEzuvaFvaMDScNZpbg9mVAS0v71v2Z2sggY87pFHW/7KCNeV5Q QkmGoAZqR6SPV8IdT8QNP9zSCulZzlPeJdyJVyamHxBs80+7el2RsVQbCHq+ak4Cccfz 7vYVFC1mK5arsy3miLuHiN2qE9nfDiomdp3Y1wrZi23SyLhq1Ut6vFahDo1e5Ox/RoLe /jUDOC1NsVjQ3BIDYdoDQsfmb/DfoXVkC7JOv1jevi13qEHhsW+zTbs8i3V+wDUd8P1m 7uKMZ8luDe2MccJ9/QgnsKTSiAhhoBEt32+PF9hQNt/U/gFrGtf/wgdjfsNH+7C+IFe1 5ijA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l81-v6si23219960pfj.127.2018.05.24.20.52.27; Thu, 24 May 2018 20:52:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964976AbeEYDu7 (ORCPT + 99 others); Thu, 24 May 2018 23:50:59 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:43510 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964889AbeEYDu4 (ORCPT ); Thu, 24 May 2018 23:50:56 -0400 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:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } -- 2.9.5