scsi: provide mq_ops->busy() hook
authorJens Axboe <axboe@kernel.dk>
Mon, 29 Oct 2018 16:17:28 +0000 (10:17 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 Nov 2018 20:42:32 +0000 (13:42 -0700)
Only the SCSI legacy path provides a way to check if target is
currently busy, provide the same for the MQ path.

Cc: linux-scsi@vger.kernel.org
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/scsi/scsi_lib.c

index c7fccbb8f5545e463537389bc34b607de3dc9cb3..8b0345924a92ecb91df531e9d055c5dd6bfc824b 100644 (file)
@@ -1675,6 +1675,11 @@ static int scsi_lld_busy(struct request_queue *q)
        return 0;
 }
 
+static bool scsi_mq_lld_busy(struct request_queue *q)
+{
+       return scsi_lld_busy(q);
+}
+
 /*
  * Kill a request for a dead device
  */
@@ -2326,6 +2331,7 @@ static const struct blk_mq_ops scsi_mq_ops = {
        .init_request   = scsi_mq_init_request,
        .exit_request   = scsi_mq_exit_request,
        .initialize_rq_fn = scsi_initialize_rq,
+       .busy           = scsi_mq_lld_busy,
        .map_queues     = scsi_map_queues,
 };