Whamcloud - gitweb
LU-4423 lustre: don't declare extern variables in C files. 50/36650/3
authorMr NeilBrown <neilb@suse.de>
Sun, 3 Nov 2019 22:37:10 +0000 (09:37 +1100)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2019 05:58:54 +0000 (05:58 +0000)
A previous patch already removes some 'extern's.  This patch
removes the remainder from kernel code.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: If78d96edd389c602ac8ee3321492db5fedda7c69
Reviewed-on: https://review.whamcloud.com/36650
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lnet/include/lnet/lib-lnet.h
lnet/lnet/lib-move.c
lnet/lnet/router.c
lustre/fid/fid_handler.c
lustre/fid/fid_internal.h
lustre/fld/fld_index.c
lustre/lfsck/lfsck_layout.c
lustre/mdt/mdt_recovery.c
lustre/osd-ldiskfs/osd_iam.c
lustre/osd-ldiskfs/osd_iam.h
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_object.c
lustre/quota/qsd_internal.h
lustre/quota/qsd_writeback.c

index 4d1f0bf..dbbc287 100644 (file)
@@ -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);
index 4050395..75a0650 100644 (file)
@@ -42,8 +42,6 @@
 #include <linux/nsproxy.h>
 #include <net/net_namespace.h>
 
-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");
index 255a30e..2cc502d 100644 (file)
@@ -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");
index 34d0157..0b89847 100644 (file)
@@ -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))
index 2783dd0..1535ab0 100644 (file)
@@ -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 */
index f2079cb..0c1bcf2 100644 (file)
@@ -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,
index 9e93013..2bd58b0 100644 (file)
@@ -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,
index 770336a..f93840e 100644 (file)
@@ -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 */
index bc58329..a699f02 100644 (file)
@@ -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;
index e3738d7..23cd286 100644 (file)
@@ -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,
index 4e5b480..c860762 100644 (file)
 #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.
index c281207..ca0db0f 100644 (file)
@@ -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)
 {
index 7a015f2..18fc0c6 100644 (file)
@@ -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().
index 048fbd7..6ebfd8c 100644 (file)
@@ -33,8 +33,6 @@
 #include <linux/kthread.h>
 #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.