From patchwork Tue Dec 27 16:04:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9489567 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 C5A7462AB6 for ; Tue, 27 Dec 2016 16:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B85E0201BC for ; Tue, 27 Dec 2016 16:11:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD6502621F; Tue, 27 Dec 2016 16:11:29 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 5D78225D99 for ; Tue, 27 Dec 2016 16:11:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933125AbcL0QLY (ORCPT ); Tue, 27 Dec 2016 11:11:24 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34796 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933016AbcL0QHB (ORCPT ); Tue, 27 Dec 2016 11:07:01 -0500 Received: by mail-pg0-f67.google.com with SMTP id b1so12808396pgc.1; Tue, 27 Dec 2016 08:07:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qZ2KIcQOJaDnkCZeggi3lLCoSwLNsQFhCoAZy93qXSo=; b=qFhrhOb0B52a26Mj8VHhzldgcFRXkDGFsqP7nWLZnbqR9K6BrZHIWMWrXM+Rg2bnYN ciK2Bs8NhKuR2Sx5wrEkH8tpQ+QGJQ7AJ6GsyMrIm29fD7jZ+9nsBuqqSy64lcW6D+xk lkWcCiJ0ib82miuaS5pDhWvgreHqdLE+RLFiOu3qucGrGEHCtWg++DTptk06tBorgqrS crRg2LV7QQZHvdKqOvfbrOqathGKtrpqyZnkugxJv8K1YkMHD5+RLICh4EaJFeJIlezu G4iI5lt7NLvs8dw8z4T8R7YY7nVX4gTmRCqHt6RKHRnWN6wQbyVlofXU+Fg2EWHDc8+K iV4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qZ2KIcQOJaDnkCZeggi3lLCoSwLNsQFhCoAZy93qXSo=; b=Ruj9bjbeofionbTGoYQY+PQluJalTDYEyi1mJMScolh4ETbPPlmU2t+ui8kkfxdfw7 HZVnzY6h3gXSe9EUaew3BK2jsTg9tpA9kGBT5sZM+gKz7cPwdiY1YV2/KB02q4KkGUtP pIB2194XDe3ULcacYw6ntqXiyoJ/YD9vTAccwpuAv+ZZvpfE1UetYNZeSUNXFsp2Ma6F alrwl8zVY0Ob8ICQFQwvBXWSkpFvJHC9++zeV3f2WollvQ+QgDU8+rSZN0eSqgzuzAEi BB8dsjVieStvkKrMe00t+j5B2IZYkxSSM8vpfor8GfCXupn+TeSC2P5GCyJant2K/xID YBsQ== X-Gm-Message-State: AIkVDXKUasoYoRuV6gNexl5Yxv47XkJwWQPNFyjk5rsew9P3uJ2cRkcDEjOAfwrgzJoI+A== X-Received: by 10.84.196.164 with SMTP id l33mr68088245pld.150.1482854820400; Tue, 27 Dec 2016 08:07:00 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id o24sm40348705pfj.78.2016.12.27.08.06.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 08:06:59 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Alexander Viro , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)) Subject: [PATCH v1 48/54] fs/block_dev.c: convert to bio_for_each_segment_all_sp() Date: Wed, 28 Dec 2016 00:04:57 +0800 Message-Id: <1482854706-14128-17-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482854706-14128-1-git-send-email-tom.leiming@gmail.com> References: <1482854706-14128-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/block_dev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 6254cee8f8f3..644b94460348 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -209,6 +209,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)) @@ -253,7 +254,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_segment_all_sp(bvec, &bio, i, bia) { if (should_dirty && !PageCompound(bvec->bv_page)) set_page_dirty_lock(bvec->bv_page); put_page(bvec->bv_page); @@ -315,8 +316,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_segment_all(bvec, bio, i) + bio_for_each_segment_all_sp(bvec, bio, i, bia) put_page(bvec->bv_page); bio_put(bio); }