Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758198AbcDEL7R (ORCPT ); Tue, 5 Apr 2016 07:59:17 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:34737 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932170AbcDEL7M (ORCPT ); Tue, 5 Apr 2016 07:59:12 -0400 From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Boaz Harrosh , Ming Lei , Al Viro , Jarod Wilson , Tejun Heo , Miklos Szeredi , NeilBrown Subject: [PATCH 04/27] block: loop: use bio_get_base_vec() to retrive bvec table Date: Tue, 5 Apr 2016 19:56:49 +0800 Message-Id: <1459857443-20611-5-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459857443-20611-1-git-send-email-tom.leiming@gmail.com> References: <1459857443-20611-1-git-send-email-tom.leiming@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 965 Lines: 30 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 423f4ca..2a94d3bb 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)); -- 1.9.1