iscsi/portal_grp: make some functions into static and remove unused ones

1 Some functions should be static.
2 For the unused API, we delete them first. When it is used, we should add
them back.

Change-Id: I2c39e8bef96155fc71801c76534955d9cf6cb0bd
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/392721
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Ziye Yang 2017-12-22 19:22:01 +08:00 committed by Daniel Verkamp
parent 40dbe37f63
commit 82ac638d80
2 changed files with 14 additions and 26 deletions

View File

@ -330,7 +330,7 @@ error_out:
return rc;
}
struct spdk_iscsi_portal_grp *
static struct spdk_iscsi_portal_grp *
spdk_iscsi_portal_grp_create(int tag)
{
char buf[64];
@ -358,7 +358,7 @@ spdk_iscsi_portal_grp_create(int tag)
return pg;
}
void
static void
spdk_iscsi_portal_grp_destroy(struct spdk_iscsi_portal_grp *pg)
{
struct spdk_iscsi_portal *p;
@ -385,6 +385,17 @@ spdk_iscsi_portal_grp_register(struct spdk_iscsi_portal_grp *pg)
pthread_mutex_unlock(&g_spdk_iscsi.mutex);
}
static void
spdk_iscsi_portal_grp_add_portal(struct spdk_iscsi_portal_grp *pg,
struct spdk_iscsi_portal *p)
{
assert(pg != NULL);
assert(p != NULL);
p->group = pg;
TAILQ_INSERT_TAIL(&pg->head, p, per_pg_tailq);
}
/**
* If all portals are valid, this function will take their ownership.
*/
@ -442,7 +453,7 @@ spdk_iscsi_portal_grp_create_from_portal_list(int tag,
return rc;
}
int
static int
spdk_iscsi_portal_grp_create_from_configfile(struct spdk_conf_section *sp)
{
struct spdk_iscsi_portal_grp *pg;
@ -522,17 +533,6 @@ error_out:
return -1;
}
void
spdk_iscsi_portal_grp_add_portal(struct spdk_iscsi_portal_grp *pg,
struct spdk_iscsi_portal *p)
{
assert(pg != NULL);
assert(p != NULL);
p->group = pg;
TAILQ_INSERT_TAIL(&pg->head, p, per_pg_tailq);
}
struct spdk_iscsi_portal_grp *
spdk_iscsi_portal_grp_find_by_tag(int tag)
{

View File

@ -61,24 +61,12 @@ struct spdk_iscsi_portal *spdk_iscsi_portal_create(const char *host, const char
uint64_t cpumask);
void spdk_iscsi_portal_destroy(struct spdk_iscsi_portal *p);
struct spdk_iscsi_portal_grp *spdk_iscsi_portal_grp_create(int tag);
int spdk_iscsi_portal_grp_create_from_configfile(struct spdk_conf_section *sp);
int spdk_iscsi_portal_grp_create_from_portal_list(int tag,
struct spdk_iscsi_portal **portal_list,
int num_portals);
void spdk_iscsi_portal_grp_destroy(struct spdk_iscsi_portal_grp *pg);
void spdk_iscsi_portal_grp_destroy_by_tag(int tag);
void spdk_iscsi_portal_grp_release(struct spdk_iscsi_portal_grp *pg);
void spdk_iscsi_portal_grp_add_portal(struct spdk_iscsi_portal_grp *pg,
struct spdk_iscsi_portal *p);
void spdk_iscsi_portal_grp_delete_portal(struct spdk_iscsi_portal_grp *pg,
struct spdk_iscsi_portal *p);
int spdk_iscsi_portal_grp_array_create(void);
void spdk_iscsi_portal_grp_array_destroy(void);
struct spdk_iscsi_portal_grp *spdk_iscsi_portal_grp_find_by_tag(int tag);
int spdk_iscsi_portal_grp_open_all(void);