From: Mr NeilBrown Date: Sun, 3 Nov 2019 22:37:10 +0000 (+1100) Subject: LU-4423 lustre: don't declare extern variables in C files. X-Git-Tag: 2.13.51~85 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1a7720934dfb3105afd2f025c953bea2167d4e5d LU-4423 lustre: don't declare extern variables in C files. A previous patch already removes some 'extern's. This patch removes the remainder from kernel code. Signed-off-by: Mr NeilBrown Change-Id: If78d96edd389c602ac8ee3321492db5fedda7c69 Reviewed-on: https://review.whamcloud.com/36650 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Ben Evans Reviewed-by: James Simmons Reviewed-by: Petros Koutoupis Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- diff --git a/lnet/include/lnet/lib-lnet.h b/lnet/include/lnet/lib-lnet.h index 4d1f0bf..dbbc287 100644 --- a/lnet/include/lnet/lib-lnet.h +++ b/lnet/include/lnet/lib-lnet.h @@ -918,6 +918,7 @@ bool lnet_ni_unique_net(struct list_head *nilist, char *iface); void lnet_incr_dlc_seq(void); __u32 lnet_get_dlc_seq_locked(void); int lnet_get_net_count(void); +extern unsigned int lnet_current_net_count; struct lnet_peer_net *lnet_get_next_peer_net_locked(struct lnet_peer *lp, __u32 prev_lpn_id); diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 4050395..75a0650 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -42,8 +42,6 @@ #include #include -extern unsigned int lnet_current_net_count; - static int local_nid_dist_zero = 1; module_param(local_nid_dist_zero, int, 0444); MODULE_PARM_DESC(local_nid_dist_zero, "Reserved"); diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 255a30e..2cc502d 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -35,8 +35,6 @@ #define LNET_NRB_LARGE_PAGES ((LNET_MTU + PAGE_SIZE - 1) >> \ PAGE_SHIFT) -extern unsigned int lnet_current_net_count; - static char *forwarding = ""; module_param(forwarding, charp, 0444); MODULE_PARM_DESC(forwarding, "Explicitly enable/disable forwarding between networks"); diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index 34d0157..0b89847 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -456,8 +456,6 @@ LU_KEY_INIT_FINI(seq, struct seq_thread_info); /* context key: seq_thread_key */ LU_CONTEXT_KEY_DEFINE(seq, LCT_MD_THREAD | LCT_DT_THREAD); -extern const struct file_operations seq_fld_debugfs_seq_fops; - static void seq_server_debugfs_fini(struct lu_server_seq *seq) { if (!IS_ERR_OR_NULL(seq->lss_debugfs_entry)) diff --git a/lustre/fid/fid_internal.h b/lustre/fid/fid_internal.h index 2783dd0..1535ab0 100644 --- a/lustre/fid/fid_internal.h +++ b/lustre/fid/fid_internal.h @@ -91,4 +91,6 @@ extern struct dentry *seq_debugfs_dir; extern struct lprocfs_vars seq_client_debugfs_list[]; +extern const struct file_operations seq_fld_debugfs_seq_fops; + #endif /* __FID_INTERNAL_H */ diff --git a/lustre/fld/fld_index.c b/lustre/fld/fld_index.c index f2079cb..0c1bcf2 100644 --- a/lustre/fld/fld_index.c +++ b/lustre/fld/fld_index.c @@ -77,8 +77,6 @@ static const struct dt_index_features fld_index_features = { .dif_ptrsize = 4 }; -extern struct lu_context_key fld_thread_key; - int fld_declare_index_create(const struct lu_env *env, struct lu_server_fld *fld, const struct lu_seq_range *new_range, diff --git a/lustre/lfsck/lfsck_layout.c b/lustre/lfsck/lfsck_layout.c index 9e93013..2bd58b0 100644 --- a/lustre/lfsck/lfsck_layout.c +++ b/lustre/lfsck/lfsck_layout.c @@ -647,7 +647,7 @@ lfsck_rbtree_insert(struct lfsck_layout_slave_data *llsd, return lrn; } -extern const struct dt_index_operations lfsck_orphan_index_ops; +static const struct dt_index_operations lfsck_orphan_index_ops; static int lfsck_rbtree_setup(const struct lu_env *env, struct lfsck_component *com) @@ -7519,7 +7519,7 @@ static int lfsck_orphan_it_key_rec(const struct lu_env *env, return 0; } -const struct dt_index_operations lfsck_orphan_index_ops = { +static const struct dt_index_operations lfsck_orphan_index_ops = { .dio_lookup = lfsck_orphan_index_lookup, .dio_declare_insert = lfsck_orphan_index_declare_insert, .dio_insert = lfsck_orphan_index_insert, diff --git a/lustre/mdt/mdt_recovery.c b/lustre/mdt/mdt_recovery.c index 770336a..f93840e 100644 --- a/lustre/mdt/mdt_recovery.c +++ b/lustre/mdt/mdt_recovery.c @@ -67,11 +67,6 @@ const struct lu_buf *mdt_buf_const(const struct lu_env *env, return buf; } -/* - * last_rcvd & last_committed update callbacks - */ -extern struct lu_context_key mdt_thread_key; - /* This callback notifies MDT that transaction was done. This is needed by * mdt_save_lock() only. It is similar to new target code and will be removed * as mdt_save_lock() will be converted to use target structures */ diff --git a/lustre/osd-ldiskfs/osd_iam.c b/lustre/osd-ldiskfs/osd_iam.c index bc58329..a699f02 100644 --- a/lustre/osd-ldiskfs/osd_iam.c +++ b/lustre/osd-ldiskfs/osd_iam.c @@ -422,8 +422,6 @@ static int iam_leaf_keyeq(const struct iam_leaf *leaf, } #if LDISKFS_INVARIANT_ON -extern int dx_node_check(struct iam_path *p, struct iam_frame *f); - static int iam_path_check(struct iam_path *p) { int i; diff --git a/lustre/osd-ldiskfs/osd_iam.h b/lustre/osd-ldiskfs/osd_iam.h index e3738d7..23cd286 100644 --- a/lustre/osd-ldiskfs/osd_iam.h +++ b/lustre/osd-ldiskfs/osd_iam.h @@ -1112,6 +1112,7 @@ int iam_uapi_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, extern int ldiskfs_check_dir_entry(const char *, struct inode *, struct ldiskfs_dir_entry_2 *, struct buffer_head *, unsigned long); +extern int dx_node_check(struct iam_path *p, struct iam_frame *f); #else static inline int ldiskfs_check_dir_entry(const char * function, struct inode * dir, diff --git a/lustre/osd-zfs/osd_internal.h b/lustre/osd-zfs/osd_internal.h index 4e5b480..c860762 100644 --- a/lustre/osd-zfs/osd_internal.h +++ b/lustre/osd-zfs/osd_internal.h @@ -104,6 +104,8 @@ #endif extern struct dt_body_operations osd_body_scrub_ops; +extern struct dt_body_operations osd_body_ops; +extern struct kmem_cache *osd_object_kmem; /** * Iterator's in-memory data structure for quota file. diff --git a/lustre/osd-zfs/osd_object.c b/lustre/osd-zfs/osd_object.c index c281207..ca0db0f 100644 --- a/lustre/osd-zfs/osd_object.c +++ b/lustre/osd-zfs/osd_object.c @@ -66,11 +66,8 @@ static int osd_object_sync_delay_us = -1; static struct dt_object_operations osd_obj_ops; static struct lu_object_operations osd_lu_obj_ops; -extern struct dt_body_operations osd_body_ops; static struct dt_object_operations osd_obj_otable_it_ops; -extern struct kmem_cache *osd_object_kmem; - static void osd_object_sa_fini(struct osd_object *obj) { diff --git a/lustre/quota/qsd_internal.h b/lustre/quota/qsd_internal.h index 7a015f2..18fc0c6 100644 --- a/lustre/quota/qsd_internal.h +++ b/lustre/quota/qsd_internal.h @@ -33,6 +33,8 @@ struct qsd_type_info; struct qsd_fsinfo; +extern struct kmem_cache *upd_kmem; + /* * A QSD instance implements quota enforcement support for a given OSD. * The instance can be created via qsd_init() and then freed with qsd_fini(). diff --git a/lustre/quota/qsd_writeback.c b/lustre/quota/qsd_writeback.c index 048fbd7..6ebfd8c 100644 --- a/lustre/quota/qsd_writeback.c +++ b/lustre/quota/qsd_writeback.c @@ -33,8 +33,6 @@ #include #include "qsd_internal.h" -extern struct kmem_cache *upd_kmem; - /* * Allocate and fill an qsd_upd_rec structure to be processed by the writeback * thread.