Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1978216imm; Sat, 9 Jun 2018 05:36:46 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoD38017qyFJh1crpRVZw+QTUonDyVB1gXHtPbqGyAbyiSGIrB4iF7/xcoUWexQzcqJfTO X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr10670582plb.226.1528547806662; Sat, 09 Jun 2018 05:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528547806; cv=none; d=google.com; s=arc-20160816; b=N8/9Dk3sIfa1uHp2XAtb2+SsdyguEYyo/f03RVygmTAUoRfjpJVg63X3WTCwc4VA4T MGbTK1JWqirYJ/clomdIsDQSOMmbSQqSgSRWkukrJJBjUqiIBRg3sobFDoVFvYpXwqm7 nf+SMkADJ/jAhfpLAVhpTs7pnRwQo5/qK1Wo2nzGTarUDBZeuo3lyZ1HrIGWGWx2CWBw ngUtFFsYyL1pA0cz7C+2wseeW8xhrjw7p3nPKA77JxUfIy6YQwXpaxsf2yThmBwlzo8w DhwLJDyQ/OWjjtbqkloAoOW2VLffPJ93Nifcuk69BERLB8fSeHX67MwCgGzXryAKT4Lj aVGg== 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=zutiwBN2cAlkZmzpjD+1KjoNHGj0Me/e4QQ7oq6titc=; b=LbswVw5FG50b2661KLtcFbXgdPZ3qAatxGyeKDqBgZeqgf/EaYAYFLF2Mfvj5afBM+ +qpJ5XWzDyoKo7/lOjHFvB6y4L0JyFJJQLjJXUiKjOfDQdJ9dqoba5l+FOL40qGACtMR CEOGS3V34kLfIQNBD+fEHrTbMi+F4O8i+43a+dyZqZk7d7Bn2xK9HBs2y1D4jElt1Fgs eZYiTaYE09lVVta/2rnCcokf9cn3Hf6TuEoj1h6PKkvgd4lDNWwf1Aj2IdOG7UR6QbcY PFgXfAZMc97p70Ii+yCvL6eK/M8wy6uiAVFXzAlqrjoSgKFkO4gNS+jLR7bsUbY2eT2E jKOw== 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 c3-v6si58445645pfn.245.2018.06.09.05.36.32; Sat, 09 Jun 2018 05:36:46 -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 S1753580AbeFIMed (ORCPT + 99 others); Sat, 9 Jun 2018 08:34:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42436 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753388AbeFIMea (ORCPT ); Sat, 9 Jun 2018 08:34:30 -0400 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 C0AB4BB42D; Sat, 9 Jun 2018 12:34:29 +0000 (UTC) Received: from localhost (ovpn-12-40.pek2.redhat.com [10.72.12.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id C7C17210C6D4; Sat, 9 Jun 2018 12:34:23 +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 , Randy Dunlap , Ming Lei Subject: [PATCH V6 20/30] fs: conver to bio_for_each_chunk_segment_all() Date: Sat, 9 Jun 2018 20:30:04 +0800 Message-Id: <20180609123014.8861-21-ming.lei@redhat.com> In-Reply-To: <20180609123014.8861-1-ming.lei@redhat.com> References: <20180609123014.8861-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.1]); Sat, 09 Jun 2018 12:34:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Sat, 09 Jun 2018 12:34:29 +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:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bio_for_each_segment_all() can't be used any more after multipage bvec is enabled, so we have to convert to bio_for_each_chunk_segment_all(). 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 bef6934b6189..6726f8297a7b 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_chunk_iter citer; 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_segment_all(bvec, &bio, i) { + bio_for_each_chunk_segment_all(bvec, &bio, i, citer) { 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_chunk_iter citer; - bio_for_each_segment_all(bvec, bio, i) + bio_for_each_chunk_segment_all(bvec, bio, i, citer) put_page(bvec->bv_page); bio_put(bio); } diff --git a/fs/crypto/bio.c b/fs/crypto/bio.c index 0d5e6a569d58..13bcbdbf3440 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_chunk_iter citer; - bio_for_each_segment_all(bv, bio, i) { + bio_for_each_chunk_segment_all(bv, bio, i, citer) { 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 093fb54cd316..8f7fd985450a 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_segment_all(bvec, bio, i) { + struct bvec_chunk_iter citer; + + bio_for_each_chunk_segment_all(bvec, bio, i, citer) { 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 206539d369a8..dbc35c40a1c4 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -934,8 +934,9 @@ static void iomap_dio_bio_end_io(struct bio *bio) } else { struct bio_vec *bvec; int i; + struct bvec_chunk_iter citer; - bio_for_each_segment_all(bvec, bio, i) + bio_for_each_chunk_segment_all(bvec, bio, i, citer) put_page(bvec->bv_page); bio_put(bio); } diff --git a/fs/mpage.c b/fs/mpage.c index b7e7f570733a..78b372607650 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_chunk_iter citer; - bio_for_each_segment_all(bv, bio, i) { + bio_for_each_chunk_segment_all(bv, bio, i, citer) { struct page *page = bv->bv_page; page_endio(page, op_is_write(bio_op(bio)), blk_status_to_errno(bio->bi_status)); -- 2.9.5