iscsi: Extract TAILQ_INIT from IG, PG, and target nodes configuration
There are four configurable components, portal, portal group, target node, and initiator group in iSCSI. They have a TAILQ to manage their objects, respectively. Currently each TAILQ initialization is done together with its object creation by .INI config file. This patch separates TAILQ initialization from object creation for four configurable components in iSCSI. The purpose of the patch series is - to separate iSCSI subsystem initialization and iSCSI subsystem configuration, and - to develop a new JSON-RPC by reusing the separated iSCSI subsystem initialization. Change-Id: Ia4ac3f06f15acef671e785904f4c687e5d189fbe Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403140 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
0c1003e983
commit
6ef949f276
@ -627,7 +627,6 @@ spdk_iscsi_init_grp_array_create(void)
|
||||
struct spdk_conf_section *sp;
|
||||
int rc;
|
||||
|
||||
TAILQ_INIT(&g_spdk_iscsi.ig_head);
|
||||
sp = spdk_conf_first_section(NULL);
|
||||
while (sp != NULL) {
|
||||
if (spdk_conf_section_match_prefix(sp, "InitiatorGroup")) {
|
||||
|
@ -800,6 +800,11 @@ spdk_iscsi_app_read_parameters(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
TAILQ_INIT(&g_spdk_iscsi.portal_head);
|
||||
TAILQ_INIT(&g_spdk_iscsi.pg_head);
|
||||
TAILQ_INIT(&g_spdk_iscsi.ig_head);
|
||||
TAILQ_INIT(&g_spdk_iscsi.target_head);
|
||||
|
||||
spdk_iscsi_log_globals();
|
||||
|
||||
/* portal groups */
|
||||
|
@ -502,8 +502,6 @@ spdk_iscsi_portal_grp_array_create(void)
|
||||
int rc = 0;
|
||||
struct spdk_conf_section *sp;
|
||||
|
||||
TAILQ_INIT(&g_spdk_iscsi.portal_head);
|
||||
TAILQ_INIT(&g_spdk_iscsi.pg_head);
|
||||
sp = spdk_conf_first_section(NULL);
|
||||
while (sp != NULL) {
|
||||
if (spdk_conf_section_match_prefix(sp, "PortalGroup")) {
|
||||
|
@ -388,12 +388,6 @@ spdk_iscsi_send_tgts(struct spdk_iscsi_conn *conn, const char *iiqn,
|
||||
return total;
|
||||
}
|
||||
|
||||
static void
|
||||
spdk_iscsi_tgt_node_list_init(void)
|
||||
{
|
||||
TAILQ_INIT(&g_spdk_iscsi.target_head);
|
||||
}
|
||||
|
||||
struct spdk_iscsi_tgt_node *
|
||||
spdk_iscsi_find_tgt_node(const char *target_name)
|
||||
{
|
||||
@ -1205,8 +1199,6 @@ int spdk_iscsi_init_tgt_nodes(void)
|
||||
|
||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "spdk_iscsi_init_tgt_nodes\n");
|
||||
|
||||
spdk_iscsi_tgt_node_list_init();
|
||||
|
||||
sp = spdk_conf_first_section(NULL);
|
||||
while (sp != NULL) {
|
||||
if (spdk_conf_section_match_prefix(sp, "TargetNode")) {
|
||||
|
Loading…
Reference in New Issue
Block a user