• Christoph Hellwig's avatar
    [PATCH] rationalize scsi_queue_next & friends · 3e17fda6
    Christoph Hellwig authored
    (1)  second arg to scsi_queue_next_request() is only ever non-NULL
         inside scsi_lib.c and only used in the first conditional inside
         that function - ripped out of scsi_queue_next_request() and
         put into a new helper scsi_requeue_command().
    (2)  Most remaining callers of are in the form
    	scsi_put_command(cmd);
    	scsi_queue_next_request(q, NULL);
         add a new helper, scsi_next_command() for them.
    (2b) many callers of that still contain a repeated codepath, namely
         everything from scsi_release_request except the final kfree.
         New helper __scsi_release_request() for those.
    (3)  All remaining callers loop over the devices of a host and call
         scsi_queue_next_request() on them - new helper
         scsi_run_host_queues().
    (4)  scsi_queue_next_request() renamed to scsi_run_queue(), second
         arg is gone and it's static to scsi_lib.c now.
    3e17fda6
scsi.c 37.7 KB