From 82ac638d80f3dacb5f1edc6523ac8bf338b3a1e5 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Fri, 22 Dec 2017 19:22:01 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/392721 Reviewed-by: Tested-by: SPDK Automated Test System Reviewed-by: Daniel Verkamp --- lib/iscsi/portal_grp.c | 28 ++++++++++++++-------------- lib/iscsi/portal_grp.h | 12 ------------ 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/lib/iscsi/portal_grp.c b/lib/iscsi/portal_grp.c index d5b22f8fd..34a4017e9 100644 --- a/lib/iscsi/portal_grp.c +++ b/lib/iscsi/portal_grp.c @@ -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) { diff --git a/lib/iscsi/portal_grp.h b/lib/iscsi/portal_grp.h index 189b22ca2..0f8c5ef08 100644 --- a/lib/iscsi/portal_grp.h +++ b/lib/iscsi/portal_grp.h @@ -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);