vhost/scsi: Move sanity check into vhost_scsi_map_iov_to_sgl
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 23 Feb 2014 02:34:08 +0000 (18:34 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 2 Jun 2014 19:41:54 +0000 (12:41 -0700)
commit5a01d08217e39f3d36d3ca160361c7b019ff1598
tree15d4b1d9b66bd8e6dce24569c93f718cac1d8bab
parent1b49dcf3d7c765ad18ca7167a0e441824eb1f7af
vhost/scsi: Move sanity check into vhost_scsi_map_iov_to_sgl

Move the overflow check for sgl_count > TCM_VHOST_PREALLOC_SGLS into
vhost_scsi_map_iov_to_sgl() so that it's based on the total number
of SGLs for all IOVs, instead of single IOVs.

Also, rename TCM_VHOST_PREALLOC_PAGES -> TCM_VHOST_PREALLOC_UPAGES
to better describe pointers to user-space pages.

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>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/vhost/scsi.c