From patchwork Sat Jun 9 12:30:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 10455619 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 5C4A4601F7 for ; Sat, 9 Jun 2018 12:35:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D45E1FF83 for ; Sat, 9 Jun 2018 12:35:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EA25223A6; Sat, 9 Jun 2018 12:35:02 +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 C4D841FF83 for ; Sat, 9 Jun 2018 12:35:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3D9B6B028E; Sat, 9 Jun 2018 08:35:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CEE056B0290; Sat, 9 Jun 2018 08:35:00 -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 C057C6B0291; Sat, 9 Jun 2018 08:35:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id 94F146B028E for ; Sat, 9 Jun 2018 08:35:00 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id f8-v6so4524464qth.9 for ; Sat, 09 Jun 2018 05:35:00 -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=wfiOS1dDRmBAOTyZ26sD/8fBvfakGDxC/aQlkOcSv78=; b=JsJfaT1Wm3yniewVfDHd4ivalAFumb5X6KCrwoq94VeJNjrCdGa+XED2se7iNLeToi bmIW2lPgXZ/abttHHljx+GSAdTJkkfgcMZk6+m3uKQ84ZgMu9yCS6qDaKGbv7Jrj/gBB ZwZmiQrGrxs5LFjeWLe7t7MC57MLLPXxCpAQ7Dv/m0BmWgN4UZD7TMhsJz0b6EfE65Af co5DvSgYCoNfYPx5um1pMotkztUtiEI2h+umyS1gTYRzvAXz1oKWxXXknVr4ez1zD5n8 cwAj6fEz1JsU+mN+927Js6FML2SIZrljJUWOkG5fxwDAnCAX06Sg204iDjZ1UHo6Z+vJ Mp5g== 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: APt69E29bo/BoFn8mSIiIA1E1yeqpsuxFp36baes8Ywy5MxujoRQSk0s nitPAH1hgHb3du5F7G1w7kUAUDGNB+HgC7Z3ffv68Oj0Fv7J8cUs5YsT9Sc3mo/FXMM98KZkVF8 W8c0r5o0hQZj4mpsFm8YyXNQx6f36YRvxIDfEGGgaKyYlU4/iFFErTmTdWiYx6fXeLw== X-Received: by 2002:aed:3c18:: with SMTP id t24-v6mr9741681qte.301.1528547700422; Sat, 09 Jun 2018 05:35:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL5XZ9qk8QAihO013S4TkeJFFtwVaT2QLBH8DkXUw2qrA68goAgRB/TbbV2r/3qYV240uMr X-Received: by 2002:aed:3c18:: with SMTP id t24-v6mr9741649qte.301.1528547699710; Sat, 09 Jun 2018 05:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528547699; cv=none; d=google.com; s=arc-20160816; b=nqTksj7bhw3Yj5KYejHmrJy8siYw13Nu7ktBvoxGHM3kif6ht0CznzsJWrT+ioGdhY XXx5F4V4pBzTk4N7Xj3xXO2Qi9a07Drj2QPV0mMQzakY0Bl6BKhyLzaWHLKZCDiPJ28w 22VqxhWf2kuboq8AGlDAerejPyslNIEs7uIZxnEATQeJ9gx2BSVF9WT+SyXFcIrsECpA DKNu1t+C3bz9Bc+d0dpLnQEo3Vk4FlTe/a3x9toiHPQ3PQWTJpFmCR/sUIhkgHc+Cyl9 sf/mMlKfyZqveDAqrvUiZCkJ/S87SfCPvIFUtpHpmmekMLF17h3EPYi38j5x7m49HxSs D2dw== 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=wfiOS1dDRmBAOTyZ26sD/8fBvfakGDxC/aQlkOcSv78=; b=O2kEIHe7gDJRVXaWYMLmAXdO/4p+Oxgk/D3jyhpsLTyte1QIqO8BMwX6Mjr91ATIHq W4JXA64U70ARi7nDNdFuuqgTdLmeIEWkZI/wOvm+tFtfm8kDyFDFBT3BgMledbs2W63m IfIfeENzFeibI93dLeC0F9nEKv1P9aL8tR/SWGjyx1cSQfERTW05kxpGWoNloTYiVx5p vnhj5Z9YDnXZ1ge3rwdb6i+SU6ZvPiIm6cjjt7uc0wGVNQPVu0hrVZMApM2f6FhC/Wqy ML3mJShmSO1r0RSAgOlQ+JE9eLi1g15jBrqUz1evN0+PQ3bzOAIC/MYHPC8U+gZHEe1+ X0bA== 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 39-v6si199065qtv.111.2018.06.09.05.34.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 05:34:59 -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 4AF18406E8CB; Sat, 9 Jun 2018 12:34:59 +0000 (UTC) Received: from localhost (ovpn-12-40.pek2.redhat.com [10.72.12.40]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD88D2166BB2; Sat, 9 Jun 2018 12:34:53 +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 23/30] f2fs: conver to bio_for_each_chunk_segment_all Date: Sat, 9 Jun 2018 20:30:07 +0800 Message-Id: <20180609123014.8861-24-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.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sat, 09 Jun 2018 12:34:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Sat, 09 Jun 2018 12:34:59 +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_chunk_segment_all(). Signed-off-by: Ming Lei --- fs/f2fs/data.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 02237d4d91f5..00ee386b902c 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -54,6 +54,7 @@ static void f2fs_read_end_io(struct bio *bio) { struct bio_vec *bvec; int i; + struct bvec_chunk_iter citer; #ifdef CONFIG_F2FS_FAULT_INJECTION if (time_to_inject(F2FS_P_SB(bio_first_page_all(bio)), FAULT_IO)) { @@ -71,7 +72,7 @@ static void f2fs_read_end_io(struct bio *bio) } } - bio_for_each_segment_all(bvec, bio, i) { + bio_for_each_chunk_segment_all(bvec, bio, i, citer) { struct page *page = bvec->bv_page; if (!bio->bi_status) { @@ -91,8 +92,9 @@ static void f2fs_write_end_io(struct bio *bio) struct f2fs_sb_info *sbi = bio->bi_private; 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) { struct page *page = bvec->bv_page; enum count_type type = WB_DATA_TYPE(page); @@ -267,6 +269,7 @@ static bool __has_merged_page(struct f2fs_bio_info *io, struct bio_vec *bvec; struct page *target; int i; + struct bvec_chunk_iter citer; if (!io->bio) return false; @@ -274,7 +277,7 @@ static bool __has_merged_page(struct f2fs_bio_info *io, if (!inode && !ino) return true; - bio_for_each_segment_all(bvec, io->bio, i) { + bio_for_each_chunk_segment_all(bvec, io->bio, i, citer) { if (bvec->bv_page->mapping) target = bvec->bv_page;