From: Andrew Morton Signed-off-by: Andrew Morton --- include/linux/blkdev.h | 2 ++ include/scsi/scsi_tcq.h | 11 +++++++++++ 2 files changed, 13 insertions(+) diff -puN include/linux/blkdev.h~git-scsi-misc-fixup include/linux/blkdev.h --- a/include/linux/blkdev.h~git-scsi-misc-fixup +++ a/include/linux/blkdev.h @@ -766,6 +766,8 @@ extern int blk_queue_resize_tags(request extern void blk_queue_invalidate_tags(request_queue_t *); extern long blk_congestion_wait(int rw, long timeout); extern void blk_congestion_end(int rw); +extern struct blk_queue_tag *blk_init_tags(int); +extern void blk_free_tags(struct blk_queue_tag *); extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); extern int blkdev_issue_flush(struct block_device *, sector_t *); diff -puN include/scsi/scsi_tcq.h~git-scsi-misc-fixup include/scsi/scsi_tcq.h --- a/include/scsi/scsi_tcq.h~git-scsi-misc-fixup +++ a/include/scsi/scsi_tcq.h @@ -133,5 +133,16 @@ static inline struct scsi_cmnd *scsi_fin return sdev->current_cmnd; } +/** + * scsi_init_shared_tag_map - create a shared tag map + * @shost: the host to share the tag map among all devices + * @depth: the total depth of the map + */ +static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) +{ + shost->bqt = blk_init_tags(depth); + return shost->bqt ? 0 : -ENOMEM; +} + #endif /* CONFIG_BLOCK */ #endif /* _SCSI_SCSI_TCQ_H */ _