diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-27 11:41:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-27 11:41:51 -0700 |
commit | 49fdf6785fd660e18a1eb4588928f47e9fa29a9a (patch) | |
tree | 71cccf385d734bfc33e9cd4752b5046aef99c130 /include | |
parent | b70a6b27ed4cbb9ea7a4e1abc080ed65692ecb9b (diff) | |
parent | 43a49cbdf31e812c0d8f553d433b09b421f5d52c (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
libata: fix NCQ devices behind port multipliers
scsi: make sure that scsi_init_shared_tag_map() doesn't overwrite existing map
Diffstat (limited to 'include')
-rw-r--r-- | include/scsi/scsi_tcq.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h index cf4c219c0b5..17231385cb3 100644 --- a/include/scsi/scsi_tcq.h +++ b/include/scsi/scsi_tcq.h @@ -140,8 +140,18 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) */ 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; + /* + * If the shared tag map isn't already initialized, do it now. + * This saves callers from having to check ->bqt when setting up + * devices on the shared host (for libata) + */ + if (!shost->bqt) { + shost->bqt = blk_init_tags(depth); + if (!shost->bqt) + return -ENOMEM; + } + + return 0; } /** |