From 502c141440b4e6a75a1162d25ba98315abe7ca4e Mon Sep 17 00:00:00 2001 From: frank zago Date: Tue, 7 Jul 2015 14:33:35 -0400 Subject: [PATCH] LU-5829 libcfs: remove unnecessary EXPORT_SYMBOL A lot of symbols don't need to be exported at all because they are only used in the module they belong to. Signed-off-by: frank zago Change-Id: Ie386a75bb8d9b5b77360ea2c714aba886dd8f780 Reviewed-on: http://review.whamcloud.com/13319 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/libcfs.h | 3 --- libcfs/include/libcfs/libcfs_private.h | 2 -- libcfs/include/libcfs/libcfs_string.h | 2 -- libcfs/libcfs/debug.c | 14 -------------- libcfs/libcfs/hash.c | 12 ------------ libcfs/libcfs/libcfs_mem.c | 2 -- libcfs/libcfs/libcfs_string.c | 3 +-- libcfs/libcfs/linux/linux-cpu.c | 4 ---- libcfs/libcfs/linux/linux-crypto-adler.c | 2 -- libcfs/libcfs/linux/linux-crypto-crc32.c | 2 -- libcfs/libcfs/linux/linux-curproc.c | 1 - libcfs/libcfs/linux/linux-debug.c | 2 -- libcfs/libcfs/watchdog.c | 19 +++++++++---------- 13 files changed, 10 insertions(+), 58 deletions(-) diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index 6c8dba3..1354f1f 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -146,9 +146,6 @@ void lc_watchdog_disable(struct lc_watchdog *lcw); /* Clean up the watchdog */ void lc_watchdog_delete(struct lc_watchdog *lcw); -/* Dump a debug log */ -void lc_watchdog_dumplog(pid_t pid, void *data); - #endif /* __KERNEL__ */ /* need both kernel and user-land acceptor */ diff --git a/libcfs/include/libcfs/libcfs_private.h b/libcfs/include/libcfs/libcfs_private.h index cfb146d..4f42773 100644 --- a/libcfs/include/libcfs/libcfs_private.h +++ b/libcfs/include/libcfs/libcfs_private.h @@ -258,8 +258,6 @@ int libcfs_debug_cleanup(void); int libcfs_debug_clear_buffer(void); int libcfs_debug_mark_buffer(const char *text); -void libcfs_debug_set_level(unsigned int debug_level); - #else /* !__KERNEL__ */ # ifdef LIBCFS_DEBUG # undef NDEBUG diff --git a/libcfs/include/libcfs/libcfs_string.h b/libcfs/include/libcfs/libcfs_string.h index 6374770..04201b0 100644 --- a/libcfs/include/libcfs/libcfs_string.h +++ b/libcfs/include/libcfs/libcfs_string.h @@ -81,8 +81,6 @@ char *cfs_trimwhite(char *str); int cfs_gettok(struct cfs_lstr *next, char delim, struct cfs_lstr *res); int cfs_str2num_check(char *str, int nob, unsigned *num, unsigned min, unsigned max); -int cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max, - int single_tok, struct cfs_range_expr **expr); int cfs_expr_list_match(__u32 value, struct cfs_expr_list *expr_list); int cfs_expr_list_print(char *buffer, int count, struct cfs_expr_list *expr_list); diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index c166aac..e533b8b 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -61,52 +61,40 @@ EXPORT_SYMBOL(libcfs_debug); unsigned int libcfs_debug_mb; CFS_MODULE_PARM(libcfs_debug_mb, "i", uint, 0644, "Total debug buffer size."); -EXPORT_SYMBOL(libcfs_debug_mb); unsigned int libcfs_printk = D_CANTMASK; CFS_MODULE_PARM(libcfs_printk, "i", uint, 0644, "Lustre kernel debug console mask"); -EXPORT_SYMBOL(libcfs_printk); unsigned int libcfs_console_ratelimit = 1; CFS_MODULE_PARM(libcfs_console_ratelimit, "i", uint, 0644, "Lustre kernel debug console ratelimit (0 to disable)"); -EXPORT_SYMBOL(libcfs_console_ratelimit); unsigned int libcfs_console_max_delay; CFS_MODULE_PARM(libcfs_console_max_delay, "l", uint, 0644, "Lustre kernel debug console max delay (jiffies)"); -EXPORT_SYMBOL(libcfs_console_max_delay); unsigned int libcfs_console_min_delay; CFS_MODULE_PARM(libcfs_console_min_delay, "l", uint, 0644, "Lustre kernel debug console min delay (jiffies)"); -EXPORT_SYMBOL(libcfs_console_min_delay); unsigned int libcfs_console_backoff = CDEBUG_DEFAULT_BACKOFF; CFS_MODULE_PARM(libcfs_console_backoff, "i", uint, 0644, "Lustre kernel debug console backoff factor"); -EXPORT_SYMBOL(libcfs_console_backoff); unsigned int libcfs_debug_binary = 1; -EXPORT_SYMBOL(libcfs_debug_binary); unsigned int libcfs_stack = 3 * THREAD_SIZE / 4; EXPORT_SYMBOL(libcfs_stack); -unsigned int portal_enter_debugger; -EXPORT_SYMBOL(portal_enter_debugger); - unsigned int libcfs_catastrophe; EXPORT_SYMBOL(libcfs_catastrophe); unsigned int libcfs_watchdog_ratelimit = 300; -EXPORT_SYMBOL(libcfs_watchdog_ratelimit); unsigned int libcfs_panic_on_lbug = 1; CFS_MODULE_PARM(libcfs_panic_on_lbug, "i", uint, 0644, "Lustre kernel panic on LBUG"); -EXPORT_SYMBOL(libcfs_panic_on_lbug); atomic_t libcfs_kmemory = ATOMIC_INIT(0); EXPORT_SYMBOL(libcfs_kmemory); @@ -359,8 +347,6 @@ void libcfs_debug_set_level(unsigned int debug_level) libcfs_debug = debug_level; } -EXPORT_SYMBOL(libcfs_debug_set_level); - long libcfs_log_return(struct libcfs_debug_msg_data *msgdata, long rc) { libcfs_debug_msg(msgdata, "Process leaving (rc=%lu : %ld : %lx)\n", diff --git a/libcfs/libcfs/hash.c b/libcfs/libcfs/hash.c index f2a7ca5..504ed55 100644 --- a/libcfs/libcfs/hash.c +++ b/libcfs/libcfs/hash.c @@ -593,7 +593,6 @@ cfs_hash_bd_move_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd_old, if (unlikely(nbkt->hsb_version == 0)) nbkt->hsb_version++; } -EXPORT_SYMBOL(cfs_hash_bd_move_locked); enum { /** always set, for sanity (avoid ZERO intent) */ @@ -691,7 +690,6 @@ cfs_hash_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, CFS_HS_LOOKUP_IT_ADD | (!noref * CFS_HS_LOOKUP_MASK_REF)); } -EXPORT_SYMBOL(cfs_hash_bd_findadd_locked); struct hlist_node * cfs_hash_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, @@ -701,7 +699,6 @@ cfs_hash_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, return cfs_hash_bd_lookup_intent(hs, bd, key, hnode, CFS_HS_LOOKUP_IT_FINDDEL); } -EXPORT_SYMBOL(cfs_hash_bd_finddel_locked); static void cfs_hash_multi_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -851,21 +848,18 @@ cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, cfs_hash_bd_order(&bds[0], &bds[1]); } -EXPORT_SYMBOL(cfs_hash_dual_bd_get); void cfs_hash_dual_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl) { cfs_hash_multi_bd_lock(hs, bds, 2, excl); } -EXPORT_SYMBOL(cfs_hash_dual_bd_lock); void cfs_hash_dual_bd_unlock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl) { cfs_hash_multi_bd_unlock(hs, bds, 2, excl); } -EXPORT_SYMBOL(cfs_hash_dual_bd_unlock); struct hlist_node * cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -873,7 +867,6 @@ cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, { return cfs_hash_multi_bd_lookup_locked(hs, bds, 2, key); } -EXPORT_SYMBOL(cfs_hash_dual_bd_lookup_locked); struct hlist_node * cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -883,7 +876,6 @@ cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, return cfs_hash_multi_bd_findadd_locked(hs, bds, 2, key, hnode, noref); } -EXPORT_SYMBOL(cfs_hash_dual_bd_findadd_locked); struct hlist_node * cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -891,7 +883,6 @@ cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, { return cfs_hash_multi_bd_finddel_locked(hs, bds, 2, key, hnode); } -EXPORT_SYMBOL(cfs_hash_dual_bd_finddel_locked); static void cfs_hash_buckets_free(struct cfs_hash_bucket **buckets, @@ -1823,7 +1814,6 @@ cfs_hash_rehash_cancel_locked(struct cfs_hash *hs) cfs_hash_lock(hs, 1); } } -EXPORT_SYMBOL(cfs_hash_rehash_cancel_locked); void cfs_hash_rehash_cancel(struct cfs_hash *hs) @@ -1832,7 +1822,6 @@ cfs_hash_rehash_cancel(struct cfs_hash *hs) cfs_hash_rehash_cancel_locked(hs); cfs_hash_unlock(hs, 1); } -EXPORT_SYMBOL(cfs_hash_rehash_cancel); int cfs_hash_rehash(struct cfs_hash *hs, int do_rehash) @@ -1862,7 +1851,6 @@ cfs_hash_rehash(struct cfs_hash *hs, int do_rehash) return cfs_hash_rehash_worker(&hs->hs_rehash_wi); } -EXPORT_SYMBOL(cfs_hash_rehash); static int cfs_hash_rehash_bd(struct cfs_hash *hs, struct cfs_hash_bd *old) diff --git a/libcfs/libcfs/libcfs_mem.c b/libcfs/libcfs/libcfs_mem.c index c7dc6d8..0f1fb56 100644 --- a/libcfs/libcfs/libcfs_mem.c +++ b/libcfs/libcfs/libcfs_mem.c @@ -134,7 +134,6 @@ cfs_percpt_current(void *vars) return arr->va_ptrs[cpt]; } -EXPORT_SYMBOL(cfs_percpt_current); void * cfs_percpt_index(void *vars, int idx) @@ -146,7 +145,6 @@ cfs_percpt_index(void *vars, int idx) LASSERT(idx >= 0 && idx < arr->va_count); return arr->va_ptrs[idx]; } -EXPORT_SYMBOL(cfs_percpt_index); /* * free variable array, see more detail in cfs_array_alloc diff --git a/libcfs/libcfs/libcfs_string.c b/libcfs/libcfs/libcfs_string.c index 06ce845..8b3ba34 100644 --- a/libcfs/libcfs/libcfs_string.c +++ b/libcfs/libcfs/libcfs_string.c @@ -284,7 +284,7 @@ EXPORT_SYMBOL(cfs_str2num_check); * \retval 0 will be returned if it can be parsed, otherwise -EINVAL or * -ENOMEM will be returned. */ -int +static int cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max, int bracketed, struct cfs_range_expr **expr) { @@ -347,7 +347,6 @@ cfs_range_expr_parse(struct cfs_lstr *src, unsigned min, unsigned max, LIBCFS_FREE(re, sizeof(*re)); return -EINVAL; } -EXPORT_SYMBOL(cfs_range_expr_parse); /** * Print the range expression \a re into specified \a buffer. diff --git a/libcfs/libcfs/linux/linux-cpu.c b/libcfs/libcfs/linux/linux-cpu.c index cfc53f1..243455b 100644 --- a/libcfs/libcfs/linux/linux-cpu.c +++ b/libcfs/libcfs/linux/linux-cpu.c @@ -85,7 +85,6 @@ cfs_cpu_core_siblings(int cpu, cpumask_t *mask) /* return cpumask of cores in the same socket */ cpumask_copy(mask, topology_core_cpumask(cpu)); } -EXPORT_SYMBOL(cfs_cpu_core_siblings); /* return number of cores in the same socket of \a cpu */ int @@ -102,7 +101,6 @@ cfs_cpu_core_nsiblings(int cpu) return num; } -EXPORT_SYMBOL(cfs_cpu_core_nsiblings); /* return cpumask of HTs in the same core */ void @@ -110,7 +108,6 @@ cfs_cpu_ht_siblings(int cpu, cpumask_t *mask) { cpumask_copy(mask, topology_thread_cpumask(cpu)); } -EXPORT_SYMBOL(cfs_cpu_ht_siblings); /* return number of HTs in the same core of \a cpu */ int @@ -134,7 +131,6 @@ cfs_node_to_cpumask(int node, cpumask_t *mask) else cpumask_clear(mask); } -EXPORT_SYMBOL(cfs_node_to_cpumask); void cfs_cpt_table_free(struct cfs_cpt_table *cptab) diff --git a/libcfs/libcfs/linux/linux-crypto-adler.c b/libcfs/libcfs/linux/linux-crypto-adler.c index dd2aafd..10b91fc 100644 --- a/libcfs/libcfs/linux/linux-crypto-adler.c +++ b/libcfs/libcfs/linux/linux-crypto-adler.c @@ -135,10 +135,8 @@ int cfs_crypto_adler32_register(void) { return crypto_register_shash(&alg); } -EXPORT_SYMBOL(cfs_crypto_adler32_register); void cfs_crypto_adler32_unregister(void) { crypto_unregister_shash(&alg); } -EXPORT_SYMBOL(cfs_crypto_adler32_unregister); diff --git a/libcfs/libcfs/linux/linux-crypto-crc32.c b/libcfs/libcfs/linux/linux-crypto-crc32.c index 3929950..58e4691 100644 --- a/libcfs/libcfs/linux/linux-crypto-crc32.c +++ b/libcfs/libcfs/linux/linux-crypto-crc32.c @@ -141,10 +141,8 @@ int cfs_crypto_crc32_register(void) { return crypto_register_shash(&alg); } -EXPORT_SYMBOL(cfs_crypto_crc32_register); void cfs_crypto_crc32_unregister(void) { crypto_unregister_shash(&alg); } -EXPORT_SYMBOL(cfs_crypto_crc32_unregister); diff --git a/libcfs/libcfs/linux/linux-curproc.c b/libcfs/libcfs/linux/linux-curproc.c index 3e92367..926fd0b 100644 --- a/libcfs/libcfs/linux/linux-curproc.c +++ b/libcfs/libcfs/linux/linux-curproc.c @@ -283,7 +283,6 @@ EXPORT_SYMBOL(cfs_cap_raise); EXPORT_SYMBOL(cfs_cap_lower); EXPORT_SYMBOL(cfs_cap_raised); EXPORT_SYMBOL(cfs_curproc_cap_pack); -EXPORT_SYMBOL(cfs_curproc_cap_unpack); EXPORT_SYMBOL(cfs_capable); /* diff --git a/libcfs/libcfs/linux/linux-debug.c b/libcfs/libcfs/linux/linux-debug.c index a140d61..c313e01 100644 --- a/libcfs/libcfs/linux/linux-debug.c +++ b/libcfs/libcfs/linux/linux-debug.c @@ -312,10 +312,8 @@ void libcfs_unregister_panic_notifier(void) } EXPORT_SYMBOL(libcfs_debug_dumpstack); -EXPORT_SYMBOL(libcfs_current); #endif /* __KERNEL__ */ -EXPORT_SYMBOL(libcfs_run_upcall); EXPORT_SYMBOL(libcfs_run_lbug_upcall); EXPORT_SYMBOL(lbug_with_loc); diff --git a/libcfs/libcfs/watchdog.c b/libcfs/libcfs/watchdog.c index 7f760bb..514bcf9 100644 --- a/libcfs/libcfs/watchdog.c +++ b/libcfs/libcfs/watchdog.c @@ -203,6 +203,15 @@ static void lcw_dump_stack(struct lc_watchdog *lcw) } } +/* + * Provided watchdog handlers + */ + +static void lc_watchdog_dumplog(pid_t pid, void *data) +{ + libcfs_debug_dumplog_internal((void *)((long_ptr_t)pid)); +} + static int lcw_dispatch_main(void *data) { int rc = 0; @@ -478,16 +487,6 @@ void lc_watchdog_delete(struct lc_watchdog *lcw) } EXPORT_SYMBOL(lc_watchdog_delete); -/* - * Provided watchdog handlers - */ - -void lc_watchdog_dumplog(pid_t pid, void *data) -{ - libcfs_debug_dumplog_internal((void *)((long_ptr_t)pid)); -} -EXPORT_SYMBOL(lc_watchdog_dumplog); - #else /* !defined(WITH_WATCHDOG) */ struct lc_watchdog *lc_watchdog_add(int timeout, -- 1.8.3.1