Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034433AbcJ2IYE (ORCPT ); Sat, 29 Oct 2016 04:24:04 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35233 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034290AbcJ2IPB (ORCPT ); Sat, 29 Oct 2016 04:15:01 -0400 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 , Kent Overstreet , Shaohua Li , Mike Christie , Hannes Reinecke , Guoqing Jiang , linux-bcache@vger.kernel.org (open list:BCACHE (BLOCK LAYER CACHE)), linux-raid@vger.kernel.org (open list:SOFTWARE RAID (Multiple Disks) SUPPORT) Subject: [PATCH 39/60] bcache: debug: switch to bio_clone_sp() Date: Sat, 29 Oct 2016 16:08:38 +0800 Message-Id: <1477728600-12938-40-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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1107 Lines: 32 The cloned bio has to be singlepage bvec based, so use bio_clone_sp(), and the allocated bvec table is enough for hold the bvecs because QUEUE_FLAG_SPLIT_MP is set for bcache. Signed-off-by: Ming Lei --- drivers/md/bcache/debug.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 71a9f05918eb..0735015b0842 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -111,12 +111,10 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) struct bvec_iter iter, citer = { 0 }; /* - * Once multipage bvec is supported, the bio_clone() - * has to make sure page count in this bio can be held - * in the new cloned bio because each single page need - * to assign to each bvec of the new bio. + * QUEUE_FLAG_SPLIT_MP can make the cloned singlepage + * bvecs to be held in the allocated bvec table. */ - check = bio_clone(bio, GFP_NOIO); + check = bio_clone_sp(bio, GFP_NOIO); if (!check) return; bio_set_op_attrs(check, REQ_OP_READ, READ_SYNC); -- 2.7.4