diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-26 22:22:10 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-03-10 14:41:53 -0800 |
commit | 41ac82b668177876d5965d5f60956fb0fbcdb514 (patch) | |
tree | 229c299330fa9c3cb4cb5a1903e0559e3e7a5d5b /include/target | |
parent | 140854cb72525246745b67300d35101ad2875a39 (diff) |
target: Add se_sess->sess_kref + get/put helpers
This patch adds basic se_session->sess_kref and get/put helpers for fabric
session reference counting. It sets the initial kref in transport_init_session()
and adds a target_release_session() callback to invoke TFO->close_session()
for final session shutdown.
Cc: Roland Dreier <roland@purestorage.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Joern Engel <joern@logfs.org>
Cc: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 1 | ||||
-rw-r--r-- | include/target/target_core_fabric.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1641dea0c28..d63079409ef 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -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; diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h index e5d8c47892b..7e76aa16700 100644 --- a/include/target/target_core_fabric.h +++ b/include/target/target_core_fabric.h @@ -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 *); |