diff options
author | Shaohua Li <shli@fb.com> | 2015-01-15 20:32:25 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-01-23 16:15:46 -0500 |
commit | ee1b6f7aff94019c09e73837054979063f722046 (patch) | |
tree | 79c7b943d7c6d62fec1874afd2c50964de054aa0 /include/scsi | |
parent | bb5c3cdda37aad22996d6da2addd58cadc0436c0 (diff) |
block: support different tag allocation policy
The libata tag allocation is using a round-robin policy. Next patch will
make libata use block generic tag allocation, so let's add a policy to
tag allocation.
Currently two policies: FIFO (default) and round-robin.
Cc: Jens Axboe <axboe@fb.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_host.h | 3 | ||||
-rw-r--r-- | include/scsi/scsi_tcq.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 019e66858ce6..e113c757d555 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -402,6 +402,9 @@ struct scsi_host_template { | |||
402 | */ | 402 | */ |
403 | unsigned char present; | 403 | unsigned char present; |
404 | 404 | ||
405 | /* If use block layer to manage tags, this is tag allocation policy */ | ||
406 | int tag_alloc_policy; | ||
407 | |||
405 | /* | 408 | /* |
406 | * Let the block layer assigns tags to all commands. | 409 | * Let the block layer assigns tags to all commands. |
407 | */ | 410 | */ |
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index 9708b28bd2aa..b27977e8aaed 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h | |||
@@ -66,7 +66,8 @@ static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) | |||
66 | * devices on the shared host (for libata) | 66 | * devices on the shared host (for libata) |
67 | */ | 67 | */ |
68 | if (!shost->bqt) { | 68 | if (!shost->bqt) { |
69 | shost->bqt = blk_init_tags(depth); | 69 | shost->bqt = blk_init_tags(depth, |
70 | shost->hostt->tag_alloc_policy); | ||
70 | if (!shost->bqt) | 71 | if (!shost->bqt) |
71 | return -ENOMEM; | 72 | return -ENOMEM; |
72 | } | 73 | } |