scsi: aha152x: use sg helper to iterate over scatterlist
authorFinn Thain <fthain@telegraphics.com.au>
Tue, 18 Jun 2019 01:37:52 +0000 (09:37 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 20 Jun 2019 19:21:33 +0000 (15:21 -0400)
commita7a253ba6c26490fb132ee682661c03a6c454fd5
treeeebf3a0d11bfc6c7ada97c9a6ea88fcf3ed85baf
parent013be03840c2ba3a2717f9cee457f01fdc4d8436
scsi: aha152x: use sg helper to iterate over scatterlist

Unlike the legacy I/O path, scsi-mq preallocates a large array to hold
the scatterlist for each request. This static allocation can consume
substantial amounts of memory on modern controllers which support a
large number of concurrently outstanding requests.

To facilitate a switch to a smaller static allocation combined with a
dynamic allocation for requests that need it, we need to make sure all
SCSI drivers handle chained scatterlists correctly.

Convert remaining drivers that directly dereference the scatterlist
array to using the iterator functions.

Finn added the change to replace SCp.buffers_residual with
sg_is_last() for fixing updating it, and the similar change has been
applied on NCR5380.c

[mkp: clarified commit message]

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/aha152x.c