Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53625
b: refs/heads/master
c: 41be144
h: refs/heads/master
i:
  53623: 4eb5e98
v: v3
  • Loading branch information
Mike Christie authored and James Bottomley committed Mar 11, 2007
1 parent 49a156e commit ea6a3a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: bf32ed33e97ac7905fa5a2bf49a634c2eaf62457
refs/heads/master: 41be14442213b6dbeea3cba2ed18a2923666278c
6 changes: 4 additions & 2 deletions trunk/drivers/scsi/scsi_transport_iscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct iscsi_internal {
struct class_device_attribute *session_attrs[ISCSI_SESSION_ATTRS + 1];
};

static int iscsi_session_nr; /* sysfs session id for next new session */
static atomic_t iscsi_session_nr; /* sysfs session id for next new session */

/*
* list of registered transports and lock that must
Expand Down Expand Up @@ -300,7 +300,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
int err;

ihost = shost->shost_data;
session->sid = iscsi_session_nr++;
session->sid = atomic_add_return(1, &iscsi_session_nr);
session->target_id = target_id;

snprintf(session->dev.bus_id, BUS_ID_SIZE, "session%u",
Expand Down Expand Up @@ -1419,6 +1419,8 @@ static __init int iscsi_transport_init(void)
printk(KERN_INFO "Loading iSCSI transport class v%s.\n",
ISCSI_TRANSPORT_VERSION);

atomic_set(&iscsi_session_nr, 0);

err = class_register(&iscsi_transport_class);
if (err)
return err;
Expand Down

0 comments on commit ea6a3a9

Please sign in to comment.