From 1c63c93beb6cad0011297137e232ae25f215a553 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Thu, 31 Jul 2014 16:22:19 -0500 Subject: [PATCH] LU-5396: ni: make local functions static This reduces the code size by about 400 bytes. Change-Id: I158c3b2c5c68f92938c29090faab1c0153d19e2e Signed-off-by: frank zago Reviewed-on: http://review.whamcloud.com/11306 Tested-by: Jenkins Reviewed-by: James Simmons Reviewed-by: Patrick Farrell Reviewed-by: Amir Shehata Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- lnet/include/lnet/lib-lnet.h | 3 --- lnet/lnet/api-ni.c | 42 +++++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index dc5cf34..b002ade 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -960,9 +960,6 @@ int lnet_router_checker_start(void); void lnet_router_checker_stop(void); void lnet_swap_pinginfo(lnet_ping_info_t *info); -int lnet_ping(lnet_process_id_t id, int timeout_ms, - lnet_process_id_t *ids, int n_ids); - int lnet_parse_ip2nets(char **networksp, char *ip2nets); int lnet_parse_routes(char *route_str, int *im_a_router); int lnet_parse_networks(struct list_head *nilist, char *networks); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 5d4968e..c5ab239 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -68,13 +68,17 @@ static int rnet_htable_size = LNET_REMOTE_NETS_HASH_DEFAULT; CFS_MODULE_PARM(rnet_htable_size, "i", int, 0444, "size of remote network hash table"); -char * +static void lnet_ping_target_fini(void); +static int lnet_ping(lnet_process_id_t id, int timeout_ms, + lnet_process_id_t *ids, int n_ids); + +static char * lnet_get_routes(void) { return routes; } -char * +static char * lnet_get_networks(void) { char *nets; @@ -97,7 +101,7 @@ lnet_get_networks(void) return "tcp"; } -void +static void lnet_init_locks(void) { spin_lock_init(&the_lnet.ln_eq_wait_lock); @@ -106,14 +110,14 @@ lnet_init_locks(void) mutex_init(&the_lnet.ln_api_mutex); } -void +static void lnet_fini_locks(void) { } #else -char * +static char * lnet_get_routes(void) { char *str = getenv("LNET_ROUTES"); @@ -121,7 +125,7 @@ lnet_get_routes(void) return (str == NULL) ? "" : str; } -char * +static char * lnet_get_networks (void) { static char default_networks[256]; @@ -161,14 +165,14 @@ lnet_get_networks (void) # ifndef HAVE_LIBPTHREAD -void lnet_init_locks(void) +static void lnet_init_locks(void) { the_lnet.ln_eq_wait_lock = 0; the_lnet.ln_lnd_mutex = 0; the_lnet.ln_api_mutex = 0; } -void lnet_fini_locks(void) +static void lnet_fini_locks(void) { LASSERT(the_lnet.ln_api_mutex == 0); LASSERT(the_lnet.ln_lnd_mutex == 0); @@ -177,7 +181,7 @@ void lnet_fini_locks(void) # else -void lnet_init_locks(void) +static void lnet_init_locks(void) { pthread_cond_init(&the_lnet.ln_eq_cond, NULL); pthread_mutex_init(&the_lnet.ln_eq_wait_lock, NULL); @@ -185,7 +189,7 @@ void lnet_init_locks(void) pthread_mutex_init(&the_lnet.ln_api_mutex, NULL); } -void lnet_fini_locks(void) +static void lnet_fini_locks(void) { pthread_mutex_destroy(&the_lnet.ln_api_mutex); pthread_mutex_destroy(&the_lnet.ln_lnd_mutex); @@ -269,7 +273,7 @@ lnet_create_locks(void) return -ENOMEM; } -void lnet_assert_wire_constants (void) +static void lnet_assert_wire_constants(void) { /* Wire protocol assertions generated by 'wirecheck' * running on Linux robert.bartonsoftware.com 2.6.8-1.521 @@ -362,7 +366,7 @@ void lnet_assert_wire_constants (void) CLASSERT ((int)sizeof(((lnet_hdr_t *)0)->msg.hello.type) == 4); } -lnd_t * +static lnd_t * lnet_find_lnd_by_type (int type) { lnd_t *lnd; @@ -504,7 +508,7 @@ lnet_freelist_fini(lnet_freelist_t *fl) #endif /* LNET_USE_LIB_FREELIST */ -__u64 lnet_create_interface_cookie (void) +static __u64 lnet_create_interface_cookie(void) { /* NB the interface cookie in wire handles guards against delayed * replies and ACKs appearing valid after reboot. Initialisation time, @@ -539,7 +543,7 @@ lnet_res_type2str(int type) } } -void +static void lnet_res_container_cleanup(struct lnet_res_container *rec) { int count = 0; @@ -583,7 +587,7 @@ lnet_res_container_cleanup(struct lnet_res_container *rec) rec->rec_type = 0; /* mark it as finalized */ } -int +static int lnet_res_container_setup(struct lnet_res_container *rec, int cpt, int type, int objnum, int objsz) { @@ -711,9 +715,9 @@ lnet_server_mode() { } #endif -int lnet_unprepare(void); +static int lnet_unprepare(void); -int +static int lnet_prepare(lnet_pid_t requested_pid) { /* Prepare to bring up the network */ @@ -808,7 +812,7 @@ lnet_prepare(lnet_pid_t requested_pid) return rc; } -int +static int lnet_unprepare (void) { /* NB no LNET_LOCK since this is the last reference. All LND instances @@ -2315,7 +2319,7 @@ LNetSnprintHandle(char *str, int len, lnet_handle_any_t h) } EXPORT_SYMBOL(LNetSnprintHandle); -int +static int lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids) { -- 1.8.3.1