From patchwork Wed Dec 16 03:18:35 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: 58482 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp440236lbb; Tue, 15 Dec 2015 19:19:25 -0800 (PST) X-Received: by 10.66.193.73 with SMTP id hm9mr60156144pac.117.1450235965072; Tue, 15 Dec 2015 19:19:25 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bw10si6019176pac.157.2015.12.15.19.19.24; Tue, 15 Dec 2015 19:19:25 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934043AbbLPDTS (ORCPT + 29 others); Tue, 15 Dec 2015 22:19:18 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:35277 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934019AbbLPDTN (ORCPT ); Tue, 15 Dec 2015 22:19:13 -0500 Received: by mail-pf0-f175.google.com with SMTP id v86so4528486pfa.2 for ; Tue, 15 Dec 2015 19:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=5nu8uHrhuHMJLxUYl4T/ZzRAPxotL9+i5jmREyGqRKw=; b=QBu0KcTcE8cTNAhXCLlyQaHaqtcnEKtGJY/qcPIJ2USE4vayWVdLSEqdmBjuxGp2uh snqSAeI7adhoJmLcfgKnXGVfxo1QOYPXI8l+ktRtx1GTaRJzWjGuT+E2kecqAx7dRKJN cJ2oENA+bN5L819LNvkQ3rhfGPFV8COONHck0= 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=klk/iWy+P2NSbOfMpTXZ0vnaZWul9r3e7CU3c8jPpoH21WThdHOYr9UBIQBRoH6ABW coLVqOdrDz/y2ha34aQMAd+ZPCwjyvMyPrXzXMGVP6dKlCJgSDrcf85bYdgRNqnZLGi7 5+mUtkr59pPV4PpcqLKBNP7notSxAhwfraZG66W7/5GPIXzaOySEAQ3wOomedK2tWWbl tdIk54ZiuLEOrR63+xRQvRXaf1kZfKNxrfq7H1sPVRUNhCiXumAj8u9Az6xFcpNX0uja 5byCzsshvk7g/JnUoBQO1MJAO5qpIjEoZN4CePMCWKC3/whe4RdRb/4wijicg64Txrpk W/MA== X-Gm-Message-State: ALoCoQmmxPdy9q0qx2hryKYjm90X4vzs0cPELmHaABzy2q10+NBlEfaxmQwMb/RThfhilusqQivaswe7g6KmjpknBYfYNyJBHA== X-Received: by 10.98.70.68 with SMTP id t65mr2077898pfa.119.1450235952822; Tue, 15 Dec 2015 19:19:12 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id sy5sm5369338pac.5.2015.12.15.19.19.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 15 Dec 2015 19:19:12 -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 v2 1/2] block: Export the __blk_bios_map_sg() to map one bio Date: Wed, 16 Dec 2015 11:18:35 +0800 Message-Id: <224caa7e50b4a4e6ed6292e3fd70cc0bf290588b.1450233399.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);