From patchwork Sat Oct 29 08:08:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9403149 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 78137606DC for ; Sat, 29 Oct 2016 08:13:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6614F2A5EC for ; Sat, 29 Oct 2016 08:13:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AC742A5F2; Sat, 29 Oct 2016 08:13:58 +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 EC96B2A5ED for ; Sat, 29 Oct 2016 08:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934383AbcJ2INF (ORCPT ); Sat, 29 Oct 2016 04:13:05 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34341 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934173AbcJ2INC (ORCPT ); Sat, 29 Oct 2016 04:13:02 -0400 Received: by mail-pf0-f194.google.com with SMTP id u84so3376195pfj.1; Sat, 29 Oct 2016 01:13:02 -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=7ZZd304PMxVFIQVUWOhF1BN67FztA31gQPP5jl+NRXE=; b=rsG6AJQeSHE+a08or1BR3y5O1QmP0jfDxnZ4f/QKo/CZZQBILsfEVCRKRCDAaAgwPf W64OwAjFa+tZD1BPF6tznw4EBQshhDsgk4Yyj3fH/i5KZmH+xednh6W/RV9b+GeV/x3k 6DVunI10LoanghGW5i58+Efkbaw0RKg5OF8nDsxk7dsqvujAucDMvLPhlW/qDeyYoQx9 9z0jeEu/igAKcJjKcNmBJtE3Mdstc0Yzwk3uYadQn5KlBiZ8QjFtEJfqCphX3XaIt1Qi Cn6j3pTXo27uCN7C5zGBVrcFmDIiFii6DQbL0dLAGAObboEVL9dIxEsIW9xuegnmDqn7 aE1w== 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=7ZZd304PMxVFIQVUWOhF1BN67FztA31gQPP5jl+NRXE=; b=P9FuBI42vyYvq53mODRvuaW341ycWxI3ToazPe44msPjnf0UXiWmpFJIBc9S5+QN29 dhWpIGHaE9YMMtMlOgnsybWIvtaq8/PQ0/0PP4I5JWQt4OagIb9SZqe5De5J3EfUZm4I Vy/HKA1KBhmRT9oreY/F9L4FL9Bqtj60tEsSdzDfjy54sIm2yWnFT1tK7ree0aEq1FDZ LJevZR3UK9vbKDgsQcVlrDuFoROURcVo7es08kzsyWzyLOSvwqEe0DFPYr5eGkxrzP91 368Z4gKyl0FgZYuf3gMCqZFMbhwCVA2D9O1cmgUcqzn1hSkY89DCw/++EP8TB2Dsskfa w1Mw== X-Gm-Message-State: ABUngveEbt+G4fQXpbTby5sde0XpUE5qUz2nGCBis1Hvk5rOYmeLAztQ5XpgwVivdEVWhw== X-Received: by 10.98.204.145 with SMTP id j17mr31489111pfk.83.1477728782032; Sat, 29 Oct 2016 01:13:02 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id z3sm23527942paw.48.2016.10.29.01.13.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:13:01 -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 , Hannes Reinecke , Mike Christie , Minfei Huang , Petr Mladek Subject: [PATCH 15/60] block: loop: comment on direct access to bvec table Date: Sat, 29 Oct 2016 16:08:14 +0800 Message-Id: <1477728600-12938-16-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 --- drivers/block/loop.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index fa1b7a90ba11..55ce4226590d 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -485,6 +485,11 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, /* nomerge for loop request queue */ WARN_ON(cmd->rq->bio != cmd->rq->biotail); + /* + * For multipage bvec support, it is safe to pass the bvec + * table to iov iterator, because iov iter still uses bvec + * iter helpers to travese bvec. + */ bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); iov_iter_bvec(&iter, ITER_BVEC | rw, bvec, bio_segments(bio), blk_rq_bytes(cmd->rq));