Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 35013
b: refs/heads/master
c: 86e33a2
h: refs/heads/master
i:
  35011: cfec4f6
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Aug 31, 2006
1 parent 2a94cfc commit 884c373
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 492dfb489658dfe4a755fa29dd0e34e9c8bd8fb8
refs/heads/master: 86e33a296c2c9ed6eece0bfff4ac776f42040504
3 changes: 3 additions & 0 deletions trunk/drivers/scsi/hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ static void scsi_host_dev_release(struct device *dev)
destroy_workqueue(shost->work_q);

scsi_destroy_command_freelist(shost);
if (shost->bqt)
blk_free_tags(shost->bqt);

kfree(shost->shost_data);

if (parent)
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/scsi/scsi_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct scsi_target;
struct Scsi_Host;
struct scsi_host_cmd_pool;
struct scsi_transport_template;
struct blk_queue_tags;


/*
Expand Down Expand Up @@ -465,6 +466,12 @@ struct Scsi_Host {
struct scsi_host_template *hostt;
struct scsi_transport_template *transportt;

/*
* area to keep a shared tag map (if needed, will be
* NULL if not)
*/
struct blk_queue_tag *bqt;

/*
* The following two fields are protected with host_lock;
* however, eh routines can safely access during eh processing
Expand Down
14 changes: 13 additions & 1 deletion trunk/include/scsi/scsi_tcq.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/blkdev.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>


#define MSG_SIMPLE_TAG 0x20
Expand Down Expand Up @@ -66,7 +67,8 @@ static inline void scsi_activate_tcq(struct scsi_device *sdev, int depth)
return;

if (!blk_queue_tagged(sdev->request_queue))
blk_queue_init_tags(sdev->request_queue, depth, NULL);
blk_queue_init_tags(sdev->request_queue, depth,
sdev->host->bqt);

scsi_adjust_queue_depth(sdev, scsi_get_tag_type(sdev), depth);
}
Expand Down Expand Up @@ -131,4 +133,14 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag)
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 void scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth)
{
shost->bqt = blk_init_tags(depth);
}

#endif /* _SCSI_SCSI_TCQ_H */

0 comments on commit 884c373

Please sign in to comment.