Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292855
b: refs/heads/master
c: 41ac82b
h: refs/heads/master
i:
  292853: 90c1144
  292851: 50e7fb1
  292847: ffbed57
v: v3
  • Loading branch information
Nicholas Bellinger committed Mar 10, 2012
1 parent c5d0f14 commit 2147c7c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 140854cb72525246745b67300d35101ad2875a39
refs/heads/master: 41ac82b668177876d5965d5f60956fb0fbcdb514
22 changes: 22 additions & 0 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ struct se_session *transport_init_session(void)
INIT_LIST_HEAD(&se_sess->sess_cmd_list);
INIT_LIST_HEAD(&se_sess->sess_wait_list);
spin_lock_init(&se_sess->sess_cmd_lock);
kref_init(&se_sess->sess_kref);

return se_sess;
}
Expand Down Expand Up @@ -313,6 +314,27 @@ void transport_register_session(
}
EXPORT_SYMBOL(transport_register_session);

static void target_release_session(struct kref *kref)
{
struct se_session *se_sess = container_of(kref,
struct se_session, sess_kref);
struct se_portal_group *se_tpg = se_sess->se_tpg;

se_tpg->se_tpg_tfo->close_session(se_sess);
}

void target_get_session(struct se_session *se_sess)
{
kref_get(&se_sess->sess_kref);
}
EXPORT_SYMBOL(target_get_session);

int target_put_session(struct se_session *se_sess)
{
return kref_put(&se_sess->sess_kref, target_release_session);
}
EXPORT_SYMBOL(target_put_session);

void transport_deregister_session_configfs(struct se_session *se_sess)
{
struct se_node_acl *se_nacl;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/target/target_core_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ struct se_session {
struct list_head sess_cmd_list;
struct list_head sess_wait_list;
spinlock_t sess_cmd_lock;
struct kref sess_kref;
};

struct se_device;
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/target/target_core_fabric.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ void __transport_register_session(struct se_portal_group *,
struct se_node_acl *, struct se_session *, void *);
void transport_register_session(struct se_portal_group *,
struct se_node_acl *, struct se_session *, void *);
void target_get_session(struct se_session *);
int target_put_session(struct se_session *);
void transport_free_session(struct se_session *);
void transport_deregister_session_configfs(struct se_session *);
void transport_deregister_session(struct se_session *);
Expand Down

0 comments on commit 2147c7c

Please sign in to comment.