@@ -740,11 +740,6 @@ one outstanding command on a queue at any given time.
Initialize internal command tagging structures for a maximum
depth of 'depth'.
- blk_queue_free_tags((struct request_queue *q)
-
- Teardown tag info associated with the queue. This will be done
- automatically by block if blk_queue_cleanup() is called on a queue
- that is using tagging.
The above are initialization and exit management, the main helpers during
normal operations are:
@@ -71,20 +71,6 @@ void __blk_queue_free_tags(struct request_queue *q)
queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
}
-/**
- * blk_queue_free_tags - release tag maintenance info
- * @q: the request queue for the device
- *
- * Notes:
- * This is used to disable tagged queuing to a device, yet leave
- * queue in function.
- **/
-void blk_queue_free_tags(struct request_queue *q)
-{
- queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
-}
-EXPORT_SYMBOL(blk_queue_free_tags);
-
static int
init_tag_map(struct request_queue *q, struct blk_queue_tag *tags, int depth)
{
@@ -1142,13 +1142,18 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk)
/*
* tag stuff
*/
-#define blk_rq_tagged(rq) \
- ((rq)->mq_ctx || ((rq)->cmd_flags & REQ_QUEUED))
+static inline bool blk_rq_tagged(struct request *rq)
+{
+ if (rq->mq_ctx)
+ return blk_queue_tagged(rq->q);
+ else
+ return (rq->cmd_flags & REQ_QUEUED);
+}
+
extern int blk_queue_start_tag(struct request_queue *, struct request *);
extern struct request *blk_queue_find_tag(struct request_queue *, int);
extern void blk_queue_end_tag(struct request_queue *, struct request *);
extern int blk_queue_init_tags(struct request_queue *, int, struct blk_queue_tag *);
-extern void blk_queue_free_tags(struct request_queue *);
extern int blk_queue_resize_tags(struct request_queue *, int);
extern void blk_queue_invalidate_tags(struct request_queue *);
extern struct blk_queue_tag *blk_init_tags(int);
@@ -67,10 +67,13 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
if (!sdev->tagged_supported)
return;
- if (!shost_use_blk_mq(sdev->host) &&
- !blk_queue_tagged(sdev->request_queue))
- blk_queue_init_tags(sdev->request_queue, depth,
- sdev->host->bqt);
+ if (shost_use_blk_mq(sdev->host)) {
+ queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, sdev->request_queue);
+ } else {
+ if (!blk_queue_tagged(sdev->request_queue))
+ blk_queue_init_tags(sdev->request_queue, depth,
+ sdev->host->bqt);
+ }
scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
}
@@ -81,9 +84,9 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
**/
static inline void scsi_deactivate_tcq(struct scsi_device *sdev, int depth)
{
- if (!shost_use_blk_mq(sdev->host) &&
- blk_queue_tagged(sdev->request_queue))
- blk_queue_free_tags(sdev->request_queue);
+ if (blk_queue_tagged(sdev->request_queue))
+ queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED,
+ sdev->request_queue);
scsi_adjust_queue_depth(sdev, 0, depth);
}