From patchwork Thu Apr 14 12:02:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8835331 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33ECFC0553 for ; Thu, 14 Apr 2016 12:12:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57C5C20173 for ; Thu, 14 Apr 2016 12:12:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6E90320122 for ; Thu, 14 Apr 2016 12:12:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754262AbcDNMMG (ORCPT ); Thu, 14 Apr 2016 08:12:06 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:35584 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754683AbcDNMDS (ORCPT ); Thu, 14 Apr 2016 08:03:18 -0400 Received: by mail-oi0-f68.google.com with SMTP id w18so9554273oie.2; Thu, 14 Apr 2016 05:03:18 -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=88Wg1xpMKsvqV/BaIfz+tjP9yTTzPWxx6olkO3QltqU=; b=n+zI6GBuR+p3i0Gk70ROKWyFxTInVzJy6m/k9iHViV3UrrU0qMsZhkDdHMybFpvk2x qYeH3+RyL90DwKQGUZMTWuWgaRYGi11QDYoehZ4hZlAIJDN5m3618BzXeM81SDHQlyGu NdR/h+A/vSXxLjcOHCk3y3imHsUcDDIVKY/W+Wm/+mwBrtlQP8LoGvuN4bUMhL9QVG3H c3tMc63575oa7jZAgDoHfzpuCfxBa52TQR3v/eG0qIvbGwP9jsZkAVm0i894TIPUabUB h+gESENKM0kxjq6f0d9/t/HAa1LhzigukD7MWCRaSBwQ1WSP7OZeGXLwk5qJyz+KTOgx SHAQ== 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=88Wg1xpMKsvqV/BaIfz+tjP9yTTzPWxx6olkO3QltqU=; b=f4spsymYECVBz8KKe89YlibO/JIJSj0wbkEivDdRxQ42MqI3ijrQKCkVpUW65MchzQ Q00l+wVGQyISK0W53WGppC73Hhw82Wv/HNTikYlRwxypEW39HccRsEJl1umvYzPbwIJR 6YQuPoJvjUIdzcq1VL17g+NHoB0oONEHDTFc9h9cefM5eG8dOfqdCa+CIuSdJCZLer2f k1U6OX76LEBAKATwa8mmdqK47fHrCP9GG9y4bhQVQupQ6WjUTv0F4CaBoYxev0VhEwK3 wvTPdj0atREE2rNCqjr3cNwBayE67d6oEFUYw01gn/TGmm8tapTFjabJrXUdFVzyTPG6 KiYA== X-Gm-Message-State: AOPr4FWUsEkIS2Z4thnRMbEz93Q9CC5RljDx/7pPdeSVHGgcy9cT+21C5wVbOhT+YWhIbA== X-Received: by 10.157.36.168 with SMTP id z37mr7803116ota.65.1460635397899; Thu, 14 Apr 2016 05:03:17 -0700 (PDT) Received: from localhost ([12.228.154.70]) by smtp.gmail.com with ESMTPSA id x4sm13226630obs.0.2016.04.14.05.03.17 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 14 Apr 2016 05:03:17 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Jarod Wilson , Al Viro , Tejun Heo , Miklos Szeredi , NeilBrown Subject: [PATCH v1 04/27] block: loop: use bio_get_base_vec() to retrive bvec table Date: Thu, 14 Apr 2016 20:02:22 +0800 Message-Id: <1460635375-28282-5-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> References: <1460635375-28282-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-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ming Lei --- drivers/block/loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 7e5e27a..e2e9dcd 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -477,7 +477,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, loff_t pos, bool rw) { struct iov_iter iter; - struct bio_vec *bvec; + const struct bio_vec *bvec; struct bio *bio = cmd->rq->bio; struct file *file = lo->lo_backing_file; int ret; @@ -485,7 +485,8 @@ 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); - bvec = __bvec_iter_bvec(bio->bi_io_vec, bio->bi_iter); + /* passed to iterate_bvec() */ + bvec = bio_get_base_vec(bio); iov_iter_bvec(&iter, ITER_BVEC | rw, bvec, bio_segments(bio), blk_rq_bytes(cmd->rq));