vhost/scsi: Add T10 PI IOV -> SGL memory mapping logic
commite31885dd901e80d5bd528c1cbedde07ebbf051b2
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 23 Feb 2014 02:34:43 +0000 (22 18:34 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 2 Jun 2014 19:42:07 +0000 (2 12:42 -0700)
tree607777156b57654c5ec44a3a33667fb3938e852a
parentb1935f687bb93b207ef690f7debc0e9921fc484f
vhost/scsi: Add T10 PI IOV -> SGL memory mapping logic

This patch adds vhost_scsi_map_iov_to_prot() to perform the mapping of
T10 data integrity memory between virtio iov + struct scatterlist using
get_user_pages_fast() following existing code.

As with vhost_scsi_map_iov_to_sgl(), this does sanity checks against the
total prot_sgl_count vs. pre-allocated SGLs, and loops across protection
iovs using vhost_scsi_map_to_sgl() to perform the actual memory mapping.

Also update tcm_vhost_release_cmd() to release associated tvc_prot_sgl[]
struct page.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
Cc: H. Peter Anvin <hpa@zytor.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/vhost/scsi.c