From patchwork Tue Dec 27 15:55:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9489535 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 A99EC601D2 for ; Tue, 27 Dec 2016 16:09:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99663201BC for ; Tue, 27 Dec 2016 16:09:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CB0625F31; Tue, 27 Dec 2016 16:09:17 +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 3E602201BC for ; Tue, 27 Dec 2016 16:09:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932821AbcL0QJI (ORCPT ); Tue, 27 Dec 2016 11:09:08 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34126 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933114AbcL0QHk (ORCPT ); Tue, 27 Dec 2016 11:07:40 -0500 Received: by mail-pf0-f193.google.com with SMTP id y68so18354670pfb.1; Tue, 27 Dec 2016 08:07:39 -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=CqgM/NZwRVrJS8Xm8yjaokNEUOZwu45HdPsmpRcs+KI=; b=MAtVoBA5prei7e9GfDu3Ny61U5Pujk6xFITXgu0uOah6OgYUMQFmPE0mGTUprCZSK3 mKQpjf8Es6qSr0EIP+uKG0eTpD7HV9o7LeR+kBRNug96Hs8s5I7VE+AQRWNkqxgPPmWE YYeqZqdvw4ftNxv1lQrd4McdTmg9KAAwzlwcOrrt1Nz6lGt2oK8/IW3EAj+Emq50tpbR OuNqAA+ABaEjyhYTLCS4N2DdyTGOJ9avr9AjQJKqgaQb6eVHzZ/dVbqoJaMlsmp/CgI7 G3Ofzw2fozxXZHGSM2RDnO08qt56WpqUcMl/i+nXI51eGpDuDi7eYH12Ps4T1TI0sl6t Od9A== 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=CqgM/NZwRVrJS8Xm8yjaokNEUOZwu45HdPsmpRcs+KI=; b=edHyf6gdrK3doEA1JS3sknaSy6Kz3J7sfWw2D/54AW1hYMnC/8L374DluBexD9Dv9w +crRLUCzWN94iL0j4X6KAaAE7uxuUA/djZMRDAVKqn6mMazTq/A0KlRZA5yAPTDtw2LA 1qALH+E51e22KK5ApESmcKlzUbx0sOCqw03u1cVkPrt8SpjQWwHx9/wSs6YpYWZfQf3d ztnADBuK5ophESLv7crW8G+kx+egCkiIt35/YsZX8RVxS5xpDFx9OVrb/4wLcWvTKfuG s65XAt8IoFjrZVceB7dp7zysDE520yOdwMA32TQHCbNA8CTViKv/MZ3Pw4wfHjZVcajS fTRA== X-Gm-Message-State: AIkVDXKvyqnnoOEVdosCb+W+XZkhCr9NAwNIJiW2bFaRPbazfCGAXl+YkNDJguxXvT+Oqw== X-Received: by 10.84.174.129 with SMTP id r1mr68894009plb.19.1482854319278; Tue, 27 Dec 2016 07:58:39 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id k192sm71607477pgc.3.2016.12.27.07.58.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 07:58:37 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Hannes Reinecke , Mike Christie , Jeff Moyer , Minfei Huang , Omar Sandoval , Petr Mladek Subject: [PATCH v1 02/54] block: loop: comment on direct access to bvec table Date: Tue, 27 Dec 2016 23:55:51 +0800 Message-Id: <1482854250-13481-3-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482854250-13481-1-git-send-email-tom.leiming@gmail.com> References: <1482854250-13481-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 f347285c67ec..be1cc51815ac 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));