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: 58323 Delivered-To: patch@linaro.org Received: by 10.112.73.68 with SMTP id j4csp1319504lbv; Mon, 14 Dec 2015 00:24:53 -0800 (PST) X-Received: by 10.66.136.47 with SMTP id px15mr11832325pab.102.1450081493680; Mon, 14 Dec 2015 00:24:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 82si7260280pfq.220.2015.12.14.00.24.52; Mon, 14 Dec 2015 00:24:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752910AbbLNIYo (ORCPT + 28 others); Mon, 14 Dec 2015 03:24:44 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:33786 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752864AbbLNIYk (ORCPT ); Mon, 14 Dec 2015 03:24:40 -0500 Received: by pfnn128 with SMTP id n128so102011947pfn.0 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=Kaqda+fqq3eD18BgjVb3nmVzJBgibnnRp23tl2ZfmEjGI7Qy15PcZPlxkHQ+T2+qEE nWaS6oHHZ7WgFIZhf4Eud8HZHjujNS/kkBtZxvGJdqnIuAXJWnmrDVDAHtEugusgYTqK 5ZLwWzXdBRpYhE1XPxe+nthH0Tw0mvEhXYy0Y4iJLuej7B5cs9pM/SkJGcHOcSQ0kBDc JOIAV+wTA7aCfIB1FVYKg2sAN9OKp1xFWPLD8bhEnFL5bEZdrRWag9ZR8AyxAjG2DYT1 RipQjIV43YYXR0nm1QBW+kpqwuWcI8/2quOCxzFe6NT389hETBUnQzuzCclv0BjE11OE jxww== X-Gm-Message-State: ALoCoQkpBOsCThcwAxCkLVH5th0eiY0mDjSCFaKqClHuKtWvg0E6vQPx0Wj5G5A+914+XiMVUD5bW0oYsAv/3XQ/VGWq+Vb7kw== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ 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);