diff options
author | Christoph Hellwig <hch@lst.de> | 2014-11-03 08:09:02 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-11-12 05:19:43 -0500 |
commit | 2ecb204d07ac8debe3893c362415919bc78bebd6 (patch) | |
tree | eef99b324201b21de358dffdab8bfc0453358d5f /include/scsi/scsi_tcq.h | |
parent | e2eddf4d530df745019fded0fedfb78f6d3e33ca (diff) |
scsi: always assign block layer tags if enabled
Allow a driver to ask for block layer tags by setting .use_blk_tags in the
host template, in which case it will always see a valid value in
request->tag, similar to the behavior when using blk-mq. This means even
SCSI "untagged" commands will now have a tag, which is especially useful
when using a host-wide tag map.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Diffstat (limited to 'include/scsi/scsi_tcq.h')
-rw-r--r-- | include/scsi/scsi_tcq.h | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 005f68da5adb..fe4a70299419 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -45,40 +45,6 @@ static inline void scsi_set_tag_type(struct scsi_device *sdev, int tag) | |||
45 | break; | 45 | break; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | /** | ||
49 | * scsi_activate_tcq - turn on tag command queueing | ||
50 | * @SDpnt: device to turn on TCQ for | ||
51 | * @depth: queue depth | ||
52 | * | ||
53 | * Notes: | ||
54 | * Eventually, I hope depth would be the maximum depth | ||
55 | * the device could cope with and the real queue depth | ||
56 | * would be adjustable from 0 to depth. | ||
57 | **/ | ||
58 | static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth) | ||
59 | { | ||
60 | if (!sdev->tagged_supported) | ||
61 | return; | ||
62 | |||
63 | if (shost_use_blk_mq(sdev->host)) | ||
64 | queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue); | ||
65 | else if (!blk_queue_tagged(sdev->request_queue)) | ||
66 | blk_queue_init_tags(sdev->request_queue, depth, | ||
67 | sdev->host->bqt); | ||
68 | |||
69 | scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth); | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * scsi_deactivate_tcq - turn off tag command queueing | ||
74 | * @SDpnt: device to turn off TCQ for | ||
75 | **/ | ||
76 | static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth) | ||
77 | { | ||
78 | if (blk_queue_tagged(sdev->request_queue)) | ||
79 | blk_queue_free_tags(sdev->request_queue); | ||
80 | scsi_adjust_queue_depth(sdev, 0, depth); | ||
81 | } | ||
82 | 48 | ||
83 | static inline struct scsi_cmnd *scsi_mq_find_tag(struct Scsi_Host *shost, | 49 | static inline struct scsi_cmnd *scsi_mq_find_tag(struct Scsi_Host *shost, |
84 | int unique_tag) | 50 | int unique_tag) |