From: Logan Gunthorpe Subject: [PATCH v2 15/21] xen-blkfront: Make use of the new sg_map helper function Date: Tue, 25 Apr 2017 12:21:02 -0600 Message-ID: <1493144468-22493-16-git-send-email-logang@deltatee.com> References: <1493144468-22493-1-git-send-email-logang@deltatee.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: Jens Axboe , Juergen Gross , "James E.J. Bottomley" , "Martin K. Petersen" , Matthew Wilcox , Boris Ostrovsky , Greg Kroah-Hartman , Konrad Rzeszutek Wilk , Sumit Semwal , Ross Zwisler , Dan Williams , Stephen Bates , Logan Gunthorpe , Christoph Hellwig , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= To: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-nvdimm@lists.01.org, linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, target-devel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, dm-devel@redhat.com Return-path: In-Reply-To: <1493144468-22493-1-git-send-email-logang@deltatee.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" List-Id: linux-crypto.vger.kernel.org U3RyYWlnaHRmb3J3YXJkIGNvbnZlcnNpb24gdG8gdGhlIG5ldyBoZWxwZXIsIGV4Y2VwdCBkdWUg dG8gdGhlIGxhY2sKb2YgZXJyb3IgcGF0aCwgd2UgaGF2ZSB0byB1c2UgU0dfTUFQX01VU1RfTk9U X0ZBSUwgd2hpY2ggbWF5IEJVR19PTiBpbgpjZXJ0YWluIGNhc2VzIGluIHRoZSBmdXR1cmUuCgpT aWduZWQtb2ZmLWJ5OiBMb2dhbiBHdW50aG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