From: NeilBrown Date: Sun, 23 Jun 2019 13:34:50 +0000 (-0400) Subject: LU-4423 lustre: don't declare extern variables in C files. X-Git-Tag: 2.12.56~53 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b43c7cc6cba514687ebcbeaa1a7dcc8cf7ffa694 LU-4423 lustre: don't declare extern variables in C files. 'extern' declarations should only appear in .h files. All these names are declared in .h files as needed, and these duplicate declarations in .c files can be removed. Test-Parameters: trivial Change-Id: Ic563789f350fd21fd033f1d3c49cdac2125b86c5 Signed-off-by: NeilBrown Reviewed-on: https://review.whamcloud.com/35294 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Petros Koutoupis --- diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index da90fb1..12ffa08 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -136,8 +136,6 @@ const char *ldlm_it2str(enum ldlm_intent_flags it) } EXPORT_SYMBOL(ldlm_it2str); -extern struct kmem_cache *ldlm_lock_slab; - #ifdef HAVE_SERVER_SUPPORT static ldlm_processing_policy ldlm_processing_policy_table[] = { [LDLM_PLAIN] = ldlm_process_plain_lock, diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 9d47ac6..3c518aa 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -140,8 +140,6 @@ */ #define LDLM_POOL_SLV_SHIFT (10) -extern struct proc_dir_entry *ldlm_ns_proc_dir; - static inline __u64 dru(__u64 val, __u32 shift, int round_up) { return (val + (round_up ? (1 << shift) - 1 : 0)) >> shift; diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index ded251a..6d28079 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -1035,8 +1035,6 @@ out_ref: } EXPORT_SYMBOL(ldlm_namespace_new); -extern struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock); - /** * Cancel and destroy all locks on a resource. * diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index b8b9951..119d04c 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1794,7 +1794,6 @@ void ptlrpc_cleanup_imp(struct obd_import *imp) } /* Adaptive Timeout utils */ -extern unsigned int at_min, at_max, at_history; /* Update at_current with the specified value (bounded by at_min and at_max), * as well as the AT history "bins". diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 5ab39e1..371c784 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -3583,7 +3583,6 @@ nrs_tbf_type_flag(struct ptlrpc_service *svc, enum ptlrpc_nrs_queue_type queue) return type; } -extern struct nrs_core nrs_core; #define LPROCFS_WR_NRS_TBF_MAX_CMD (4096) static ssize_t ptlrpc_lprocfs_nrs_tbf_rule_seq_write(struct file *file, diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index b11c07d..cd73db8 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -40,11 +40,6 @@ #include "ptlrpc_internal.h" -extern spinlock_t ptlrpc_last_xid_lock; -#if RS_DEBUG -extern spinlock_t ptlrpc_rs_debug_lock; -#endif - static __init int ptlrpc_init(void) { int rc;