From patchwork Fri May 25 03:46:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10426103 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 5B480602D6 for ; Fri, 25 May 2018 03:50:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A9A5294F9 for ; Fri, 25 May 2018 03:50:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3DAC7295A4; Fri, 25 May 2018 03:50:49 +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 BC79F294F9 for ; Fri, 25 May 2018 03:50:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C23FE6B02B4; Thu, 24 May 2018 23:50:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BADE26B02B6; Thu, 24 May 2018 23:50:47 -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 A75CD6B02B7; Thu, 24 May 2018 23:50:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 79ED26B02B4 for ; Thu, 24 May 2018 23:50:47 -0400 (EDT) Received: by mail-qk0-f199.google.com with SMTP id p190-v6so2908817qkc.17 for ; Thu, 24 May 2018 20:50:47 -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=paluTtV9SxWCCnvYSqFelEk6gYBZWJjf9AKphkbEEAo=; b=rDucmmQk3st6QWOh8RUndsNvVeEsKCC2Kz1lF8SjfqW6fJHOqNV6e5E6JwoB62g9Ma 3HY2fuTQrKPSKj5kr5LUU/E59q57SXC6KwTmukcsvHgUHkzr7vkQPrLRxgO7FpktZeil +i5ioT9EoHqHWy3CPzWuAcp4Vn+3dyBV2nAjxdWMI0R5GRfiHSBekxmk8HxaX7OBtteQ z/xk8PnnhgTo0M/zPbnSmMR9absoYaCqnKkO7L7iVifDHZBl3H2btlTrrCyhjzNmApaN MMNpHSUFKYXULXSFUOq+MOQOFo8DhxSJa388cbXxGrW4GtY1GZD7KrABNpCOqVzaHH2J 1LwA== 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: ALKqPwdwFlv5AdEQ83ZLAtoeupb4HODKrR1RcwqAkL7sawWZaMBMKsQY D8JYmwheu5B0igw5bmnzM5/OMcGJBRrK3VsS61oAYcCm5Hl4WqTOvBqu64vOlmoqW71qkvV7Os2 AMheEePNTT1iGRFcJSeI4+0+wYfzYuI9TDXu6uGLulHvTYldHH7qJQApMlpD+x+sGOw== X-Received: by 2002:a0c:b40b:: with SMTP id u11-v6mr597935qve.131.1527220247299; Thu, 24 May 2018 20:50:47 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJm9eHL5QNIQx/44EXT1cgZ6bLJnwDJDD9W1SB1qAuemn0L4w2UixmiLMQ0Q09O7OrwbZcM X-Received: by 2002:a0c:b40b:: with SMTP id u11-v6mr597910qve.131.1527220246725; Thu, 24 May 2018 20:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527220246; cv=none; d=google.com; s=arc-20160816; b=MeJqwpkkwY2ywk4Hs+fmLhG+IQRaABRHiJZiqFNVulSzB3f+nX9VPUJ/jFQiClSUEF 1Y8LovcdYnCJfYYW25X6t4jwJuShoWMI45vAYuedILSDXWw4ZhhN1+1xD4zzBTmz4/tB NSf0i0Gi4DJP/jD9vv7YkDU/fhCvbjNZtqzVadh4ia4iAXuD1YJOYHzuzefFGHLO1khd 4q9DCQAwBV6GmNgWhNTu0tQdZqWhHGHUFX3AvZgcJw30Dnru6cotzLDzJCS3ikaBeu6s PaC94GUCPvMHBWMZOvz+NUtRaYTRTkQh5c0fqTFT44bdQTQ140Kli+zSFhgZLlReAf3i 6yXw== 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=paluTtV9SxWCCnvYSqFelEk6gYBZWJjf9AKphkbEEAo=; b=AeV2ZVXVf0BfihZuJ/Ras29GIui8yMPgxlBm/2oeZhBU1QMQ5aggziC5gEypcVfhcw M6nU6lSM53NAKc2SXIqUmNWRbL6sa1GbMXCcEVOaiVEib/bVYgy1nU4+Nbzs8oZZ2yQy GW1Mg9vmJagiHV3nUnZ8C3vsjdCgbdKkm6gx44tMGngSGmO7SiQHLKH5Ws7zLy+eza7o b8/3YOTM3ZgbQuRHZf+zw8fbV9462fu/6h7vN5KV7VW4U718yiuMZItQoaGzmxv7oE9j fD0VYY6S1DQWnUkVgCCXSjcttBOGcpe2ki0mD9CRxo8JJYwMOMLmBTdt10fsM7b3qaxl rsow== 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 m39-v6si3681353qtm.382.2018.05.24.20.50.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 20:50:46 -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-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A27F859A9; Fri, 25 May 2018 03:50:46 +0000 (UTC) Received: from localhost (ovpn-12-30.pek2.redhat.com [10.72.12.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3645202345C; Fri, 25 May 2018 03:50:38 +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 21/33] fs: conver to bio_for_each_page_all2 Date: Fri, 25 May 2018 11:46:09 +0800 Message-Id: <20180525034621.31147-22-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.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 25 May 2018 03:50:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 25 May 2018 03:50:46 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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/block_dev.c | 6 ++++-- fs/crypto/bio.c | 3 ++- fs/direct-io.c | 4 +++- fs/iomap.c | 3 ++- fs/mpage.c | 3 ++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 65498a34efa9..f581fc0a6142 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -197,6 +197,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, ssize_t ret; blk_qc_t qc; int i; + struct bvec_iter_all bia; if ((pos | iov_iter_alignment(iter)) & (bdev_logical_block_size(bdev) - 1)) @@ -242,7 +243,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, } __set_current_state(TASK_RUNNING); - bio_for_each_page_all(bvec, &bio, i) { + bio_for_each_page_all2(bvec, &bio, i, bia) { if (should_dirty && !PageCompound(bvec->bv_page)) set_page_dirty_lock(bvec->bv_page); put_page(bvec->bv_page); @@ -309,8 +310,9 @@ static void blkdev_bio_end_io(struct bio *bio) } else { struct bio_vec *bvec; int i; + struct bvec_iter_all bia; - bio_for_each_page_all(bvec, bio, i) + bio_for_each_page_all2(bvec, bio, i, bia) put_page(bvec->bv_page); bio_put(bio); } diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 2dda77c3a89a..743c3ecb7f97 100644 --- a/fs/crypto/bio.c +++ b/fs/crypto/bio.c @@ -37,8 +37,9 @@ static void completion_pages(struct work_struct *work) struct bio *bio = ctx->r.bio; struct bio_vec *bv; int i; + struct bvec_iter_all bia; - bio_for_each_page_all(bv, bio, i) { + bio_for_each_page_all2(bv, bio, i, bia) { struct page *page = bv->bv_page; int ret = fscrypt_decrypt_page(page->mapping->host, page, PAGE_SIZE, 0, page->index); diff --git a/fs/direct-io.c b/fs/direct-io.c index bbf25b0de9f8..e6a6dd560da2 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -551,7 +551,9 @@ static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) if (dio->is_async && dio->op == REQ_OP_READ && dio->should_dirty) { bio_check_pages_dirty(bio); /* transfers ownership */ } else { - bio_for_each_page_all(bvec, bio, i) { + struct bvec_iter_all bia; + + bio_for_each_page_all2(bvec, bio, i, bia) { struct page *page = bvec->bv_page; if (dio->op == REQ_OP_READ && !PageCompound(page) && diff --git a/fs/iomap.c b/fs/iomap.c index 42b0b1697b3d..31d19f8f0aac 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -817,8 +817,9 @@ static void iomap_dio_bio_end_io(struct bio *bio) } else { struct bio_vec *bvec; int i; + struct bvec_iter_all bia; - bio_for_each_page_all(bvec, bio, i) + bio_for_each_page_all2(bvec, bio, i, bia) put_page(bvec->bv_page); bio_put(bio); } diff --git a/fs/mpage.c b/fs/mpage.c index 1cf322c4d6f8..f2da0f9ec0f2 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -48,8 +48,9 @@ static void mpage_end_io(struct bio *bio) { struct bio_vec *bv; int i; + struct bvec_iter_all bia; - bio_for_each_page_all(bv, bio, i) { + bio_for_each_page_all2(bv, bio, i, bia) { struct page *page = bv->bv_page; page_endio(page, op_is_write(bio_op(bio)), blk_status_to_errno(bio->bi_status));