Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261716
b: refs/heads/master
c: d685759
h: refs/heads/master
v: v3
  • Loading branch information
Chandra Seetharaman authored and James Bottomley committed Jul 28, 2011
1 parent 8160b09 commit eec4589
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: f170c684b55cb8d3bab55b1fb8fa812778d551f2
refs/heads/master: d6857595394f1fa5c5752eae9bb6045c067fa41e
9 changes: 6 additions & 3 deletions trunk/drivers/scsi/device_handler/scsi_dh_rdac.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct rdac_controller {
} mode_select;
u8 index;
u8 array_name[ARRAY_LABEL_LEN];
struct Scsi_Host *host;
spinlock_t ms_lock;
int ms_queued;
struct work_struct ms_work;
Expand Down Expand Up @@ -370,15 +371,16 @@ static void release_controller(struct kref *kref)
}

static struct rdac_controller *get_controller(int index, char *array_name,
u8 *array_id)
u8 *array_id, struct scsi_device *sdev)
{
struct rdac_controller *ctlr, *tmp;

spin_lock(&list_lock);

list_for_each_entry(tmp, &ctlr_list, node) {
if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) &&
(tmp->index == index)) {
(tmp->index == index) &&
(tmp->host == sdev->host)) {
kref_get(&tmp->kref);
spin_unlock(&list_lock);
return tmp;
Expand All @@ -391,6 +393,7 @@ static struct rdac_controller *get_controller(int index, char *array_name,
/* initialize fields of controller */
memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN);
ctlr->index = index;
ctlr->host = sdev->host;
memcpy(ctlr->array_name, array_name, ARRAY_LABEL_LEN);

kref_init(&ctlr->kref);
Expand Down Expand Up @@ -513,7 +516,7 @@ static int initialize_controller(struct scsi_device *sdev,
index = 0;
else
index = 1;
h->ctlr = get_controller(index, array_name, array_id);
h->ctlr = get_controller(index, array_name, array_id, sdev);
if (!h->ctlr)
err = SCSI_DH_RES_TEMP_UNAVAIL;
}
Expand Down

0 comments on commit eec4589

Please sign in to comment.