From patchwork Mon Dec 14 08:23:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 7842241 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 7E137BEEE1 for ; Mon, 14 Dec 2015 08:25:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 932762041E for ; Mon, 14 Dec 2015 08:25:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5709203E3 for ; Mon, 14 Dec 2015 08:25:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbbLNIYn (ORCPT ); Mon, 14 Dec 2015 03:24:43 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:36749 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752863AbbLNIYk (ORCPT ); Mon, 14 Dec 2015 03:24:40 -0500 Received: by pfbu66 with SMTP id u66so57641992pfb.3 for ; Mon, 14 Dec 2015 00:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=5nu8uHrhuHMJLxUYl4T/ZzRAPxotL9+i5jmREyGqRKw=; b=giB/QcDzGPhy29qRJXLavqLlPGceOzfzruQUEwqDfV3rZBALqeZJbT7lfrDqen4O3W fdrDEVGeWGcibWL+sVaiDNRQVY3RzXZftq40vchVEOsgX62Q6NKcDnAfuzpzdyn8nlFB VhtjOtUuRPrb+PJX/FX/DKWkjKTz3WnEOs8N9EIigeKiSdf+SaGUucU+ZuiYraA+Qm5S YB/3LyK4XfqHN19hXFwuZMBtUbqKNqIsFGP8+tR3Idpq5Czgic9LRwd+0UiMfD98jB77 t5nMk7V4gHsGEEWgoLmArsOu6Mvrjc4s/SkIP5xTCQHv8x1lSKpCv8MF3LGJn/fZ2yqT LqEA== 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:in-reply-to:references; bh=5nu8uHrhuHMJLxUYl4T/ZzRAPxotL9+i5jmREyGqRKw=; b=CLKk64xh0eTGVUA6IsIYfSYUvoC+MkMgIyoz9ysYu2U1+796haeGGLlEWknug2ayWA 6ttDCyfC4WeAGqsIODGmEDAcJiOQ9diRZ2PYjJ6NO/AtiFcebWkgzAHVPFTAlXpnktIG yUYKKrKS1G3hob5iuy/HiC16EPyKAQFrlk31uvjvCbSTnYFH3VbbeOHtjXeQYD2Ub9o9 mIHfYC+WXykZsoJMX0tXG2YYfKCZE8CNKrb5HHf2gBhYjoYOXwQqomcAbFnlHliHOrW+ YFk1aAdYtb4Ak3WTzdNzsM8QnqXxxKQv/xXVKF/YXnvG2PloJ+kAqbX5Gi7JpQ/uC9bf Z78A== X-Gm-Message-State: ALoCoQlDVwmFelxby4l0WlzGA6V10WkR9OEo8eJpQjgTbkTxaoBK+3R33HgtoLKB8859rKrGgIvfILivSFnWCoUrNT408DKJog== X-Received: by 10.98.65.135 with SMTP id g7mr34200095pfd.141.1450081480324; Mon, 14 Dec 2015 00:24:40 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id c1sm41056675pas.1.2015.12.14.00.24.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Dec 2015 00:24:39 -0800 (PST) From: Baolin Wang To: axboe@kernel.dk, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com Cc: neilb@suse.com, dan.j.williams@intel.com, martin.petersen@oracle.com, sagig@mellanox.com, kent.overstreet@gmail.com, keith.busch@intel.com, tj@kernel.org, broonie@kernel.org, arnd@arndb.de, linux-block@vger.kernel.org, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: [PATCH 1/2] block: Export the __blk_bios_map_sg() to map one bio Date: Mon, 14 Dec 2015 16:23:39 +0800 Message-Id: <224caa7e50b4a4e6ed6292e3fd70cc0bf290588b.1450080755.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 In dm-crypt, it need to map one bio to scatterlist for improving the encryption efficiency. Thus this patch exports the __blk_bios_map_sg() function to map one bio with scatterlists. Signed-off-by: Baolin Wang --- block/blk-merge.c | 7 ++++--- include/linux/blkdev.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index de5716d8..09cc7c4 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -331,9 +331,9 @@ new_segment: *bvprv = *bvec; } -static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, - struct scatterlist *sglist, - struct scatterlist **sg) +int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, + struct scatterlist *sglist, + struct scatterlist **sg) { struct bio_vec bvec, bvprv = { NULL }; struct bvec_iter iter; @@ -372,6 +372,7 @@ single_segment: return nsegs; } +EXPORT_SYMBOL(__blk_bios_map_sg); /* * map a request to scatterlist, return number of sg entries setup. Caller diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3fe27f8..dd8d10f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1004,6 +1004,9 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable); extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); +extern int __blk_bios_map_sg(struct request_queue *q, struct bio *bio, + struct scatterlist *sglist, + struct scatterlist **sg); extern void blk_dump_rq_flags(struct request *, char *); extern long nr_blockdev_pages(void);