From patchwork Sat Oct 29 08:08:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9403271 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 F0FFB60587 for ; Sat, 29 Oct 2016 08:19:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDFBC29D0F for ; Sat, 29 Oct 2016 08:19:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D29412A58C; Sat, 29 Oct 2016 08:19:21 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AE8029D0F for ; Sat, 29 Oct 2016 08:19:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966400AbcJ2IQG (ORCPT ); Sat, 29 Oct 2016 04:16:06 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36057 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966390AbcJ2IQD (ORCPT ); Sat, 29 Oct 2016 04:16:03 -0400 Received: by mail-pf0-f196.google.com with SMTP id n85so3391458pfi.3; Sat, 29 Oct 2016 01:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FfgtaJsbSiHkdnrMZgImRjSKvXK0YLW6TVi27Dpud+Q=; b=KWyutihkgWdpSLbQHEKFtqAUnArSHTg8GMyl5EU59eJhKcGpiAGJ2ldBN8rPNRxtlX uJ2xm1B9K3jvNAQh/caOQi0CiPjjsG5B0yPhIC+Eol1D2P75lJbRe8BtIEGA0Ynmgi2O pzoMde4501cxUdSKFIli6m3kmJfJTrOALC6IgcnFApe+cLoN/hexTdnAdu2PlGFtcTin MTcMGtA9a5j8ZlDDldAkWPLAz9qIl5B+2N83ByTFH2mfd40EXCmYDjRILDpWJAI0juf3 2rkSQ6EqOSKEk0kPPfKfHC58MuKyehILMBNDcwoeehM/HvJwoEOmrUs9kS6r3oORFYW1 ALeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FfgtaJsbSiHkdnrMZgImRjSKvXK0YLW6TVi27Dpud+Q=; b=B60qgojjscYCXE//VI5jcP20ClZG7+R1vmT0ShrVJcIufJHqD/ggnB2cO7vlCaDLau Be0hIIzm9gfrQSUf7RMXnB4tLofDyIO2EiwvJftJEfFPr00UXR5RmjL3JirRsB38ahh7 22nnTucsywRhoeJlqZVBVlkvxE7xGX6Mulz+XWnKelhwDCb9bH2Mvg1KoMmixCT4rd65 Upm1cutB0o9czgtEae+h35G97PCONDVRnsX4bYGdEkgq228pYa8+/sZRnKPaWXO3IHCS MLLemdampcknF8AVTodbNXWmO0wkbCXUmzjsda5kbLsun9YKw7/x2+Nm2PRmuiunWAEV kFMA== X-Gm-Message-State: ABUngveRG9l48ptS/YSwLnnVjCXC5WbrseVgGRKTD9nAI66xnYInwlQ1JV7d0ZRBw01gvg== X-Received: by 10.98.50.5 with SMTP id y5mr31439710pfy.141.1477728962948; Sat, 29 Oct 2016 01:16:02 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id i123sm23559707pfg.30.2016.10.29.01.16.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:16:02 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Kirill A . Shutemov" , Ming Lei , Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net (open list:F2FS FILE SYSTEM) Subject: [PATCH 54/60] f2fs: convert to bio_for_each_segment_all_rd() Date: Sat, 29 Oct 2016 16:08:53 +0800 Message-Id: <1477728600-12938-55-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 24f6f6977d37..04b1a5caf2d6 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -33,6 +33,7 @@ static void f2fs_read_end_io(struct bio *bio) { struct bio_vec *bvec; int i; + struct bvec_iter_all bia; #ifdef CONFIG_F2FS_FAULT_INJECTION /* @@ -52,7 +53,7 @@ static void f2fs_read_end_io(struct bio *bio) } } - bio_for_each_segment_all(bvec, bio, i) { + bio_for_each_segment_all_rd(bvec, bio, i, bia) { struct page *page = bvec->bv_page; if (!bio->bi_error) { @@ -72,8 +73,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_iter_all bia; - bio_for_each_segment_all(bvec, bio, i) { + bio_for_each_segment_all_rd(bvec, bio, i, bia) { struct page *page = bvec->bv_page; fscrypt_pullback_bio_page(&page, true); @@ -145,6 +147,7 @@ static bool __has_merged_page(struct f2fs_bio_info *io, struct inode *inode, struct bio_vec *bvec; struct page *target; int i; + struct bvec_iter_all bia; if (!io->bio) return false; @@ -152,7 +155,7 @@ static bool __has_merged_page(struct f2fs_bio_info *io, struct inode *inode, if (!inode && !page && !ino) return true; - bio_for_each_segment_all(bvec, io->bio, i) { + bio_for_each_segment_all_rd(bvec, io->bio, i, bia) { if (bvec->bv_page->mapping) target = bvec->bv_page;