• Finn Thain's avatar
    scsi: aha152x: use sg helper to iterate over scatterlist · a7a253ba
    Finn Thain authored
    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: default avatarFinn Thain <fthain@telegraphics.com.au>
    Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    a7a253ba
aha152x.c 83 KB