From 9ac2b920bf2ce9edff989d0f50b5749c0b069a60 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Sun, 4 May 2025 16:19:30 -0400 Subject: [PATCH] LU-18959 misc: Mark symbols static to prevent namespace pollution Sparse highlighted a number of symbols as not used outside the file they are defined in. And a couple where they were used, but the proper header was not included, fix these issues: libcfs/libcfs/tracefile.c:37 sparse warning: symbol 'cfs_trace_data' was not declared. Should it be static? libcfs/libcfs/tracefile.c:49 sparse warning: symbol 'tctl_task' was not declared. Should it be static? lnet/lnet/lnet_rdma.c:24 sparse warning: symbol 'nvfs_shutdown' was not declared. Should it be static? lnet/lnet/lnet_rdma.c:25 sparse warning: symbol 'nvfs_ops' was not declared. Should it be static? lnet/lnet/lnet_rdma.c:26 sparse warning: symbol 'nvfs_n_ops' was not declared. Should it be static? lustre/ldlm/ldlm_lockd.c:44 sparse warning: symbol 'ldlm_kobj' was not declared. Should it be static? lustre/lfsck/lfsck_namespace.c:6916 sparse warning: symbol 'lfsck_namespace_assistant_ops' was not declared. Should it be static? lustre/lmv/lproc_lmv.c:409 sparse warning: symbol 'lprocfs_lmv_obd_vars' was not declared. Should it be static? lustre/lod/lod_dev.c:160 sparse warning: symbol 'lod_txn_callback_kmem' was not declared. Should it be static? lustre/mdc/lproc_mdc.c:572 sparse warning: symbol 'ldebugfs_mdc_obd_vars' was not declared. Should it be static? lustre/mdc/mdc_batch.c:189 sparse warning: symbol 'mdc_update_interpreters' was not declared. Should it be static? lustre/mdc/mdc_dev.c:1672 sparse warning: symbol 'mdc_lu_ops' was not declared. Should it be static? lustre/mdt/mdt_mds.c:63 sparse warning: symbol 'mds_max_io_threads' was not declared. Should it be static? lustre/mgc/lproc_mgc.c:39 sparse warning: symbol 'ldebugfs_mgc_obd_vars' was not declared. Should it be static? lustre/obdclass/hash.c:98 sparse warning: symbol 'cfs_rehash_wq' was not declared. Should it be static? lustre/obdclass/jobid.c:33 sparse warning: symbol 'jobid_hash_lock' was not declared. Should it be static? lustre/obdclass/kernelcomm.c:273 sparse warning: symbol 'stats_params' was not declared. Should it be static? lustre/obdclass/lprocfs_status.c:2610 sparse warning: symbol 'cksum_name' was not declared. Should it be static? lustre/obdclass/lprocfs_status_server.c:540 sparse warning: symbol 'ldebugfs_obd_exports_vars' was not declared. Should it be static? lustre/obdclass/lu_object.c:1883 sparse warning: symbol 'lu_env_rhash' was not declared. Should it be static? lustre/obdclass/scrub.c:464 sparse warning: symbol 'scrub_status_names' was not declared. Should it be static? lustre/obdclass/scrub.c:475 sparse warning: symbol 'scrub_flags_names' was not declared. Should it be static? lustre/obdclass/scrub.c:483 sparse warning: symbol 'scrub_param_names' was not declared. Should it be static? lustre/ofd/ofd_oss.c:28 sparse warning: symbol 'oss_max_threads' was not declared. Should it be static? lustre/osc/lproc_osc.c:664 sparse warning: symbol 'ldebugfs_osc_obd_vars' was not declared. Should it be static? lustre/osd-ldiskfs/osd_handler.c:81 sparse warning: symbol 'ldiskfs_flush_descriptors_seconds' was not declared. Should it be static? lustre/osd-ldiskfs/osd_handler.c:84 sparse warning: symbol 'ldiskfs_delayed_unlink_blocks' was not declared. Should it be static? lustre/osd-ldiskfs/osd_handler.c:90 sparse warning: symbol 'osd_itea_cachep' was not declared. Should it be static? lustre/osd-ldiskfs/osd_lproc.c:810 sparse warning: symbol 'ldebugfs_osd_obd_vars' was not declared. Should it be static? lustre/osd-zfs/osd_lproc.c:384 sparse warning: symbol 'ldebugfs_osd_obd_vars' was not declared. Should it be static? lustre/ptlrpc/nodemap_lproc.c:23 sparse warning: symbol 'nodemap_root' was not declared. Should it be static? lustre/ptlrpc/nrs_tbf.c:2284 sparse warning: symbol 'nrs_tbf_opcode_ops' was not declared. Should it be static? lustre/ptlrpc/nrs_tbf.c:2598 sparse warning: symbol 'nrs_tbf_uid_ops' was not declared. Should it be static? lustre/ptlrpc/nrs_tbf.c:2611 sparse warning: symbol 'nrs_tbf_gid_ops' was not declared. Should it be static? lustre/quota/lquota_lib.c:23 sparse warning: symbol 'lquota_caches' was not declared. Should it be static? lustre/quota/qsd_lib.c:39 sparse warning: symbol 'qsd_caches' was not declared. Should it be static? lustre/target/tgt_grant.c:61 sparse warning: symbol 'lbug_on_grant_miscount' was not declared. Should it be static? lustre/target/tgt_handler.c:1576 sparse warning: symbol 'tgt_lfsck_in_notify' was not declared. Should it be static? lustre/target/tgt_main.c:39 sparse warning: symbol 'sync_lock_cancel_show' was not declared. Should it be static? lustre/target/tgt_main.c:72 sparse warning: symbol 'sync_lock_cancel_store' was not declared. Should it be static? Change-Id: Ibdf617161fe481ddd6a2905e60890cb23ed59733 Test-Parameters: trivial Signed-off-by: Oleg Drokin Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59081 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Timothy Day --- libcfs/libcfs/tracefile.c | 4 ++-- lnet/lnet/lnet_rdma.c | 6 +++--- lustre/ldlm/ldlm_lockd.c | 2 +- lustre/lfsck/lfsck_namespace.c | 2 +- lustre/lmv/lproc_lmv.c | 2 +- lustre/lod/lod_dev.c | 2 +- lustre/mdc/lproc_mdc.c | 2 +- lustre/mdc/mdc_batch.c | 2 +- lustre/mdc/mdc_dev.c | 2 +- lustre/mdt/mdt_mds.c | 2 +- lustre/mgc/lproc_mgc.c | 2 +- lustre/obdclass/hash.c | 2 +- lustre/obdclass/jobid.c | 2 +- lustre/obdclass/kernelcomm.c | 2 +- lustre/obdclass/lprocfs_status.c | 1 + lustre/obdclass/lprocfs_status_server.c | 2 +- lustre/obdclass/lu_object.c | 2 +- lustre/obdclass/scrub.c | 6 +++--- lustre/ofd/ofd_oss.c | 2 +- lustre/osc/lproc_osc.c | 2 +- lustre/osd-ldiskfs/osd_handler.c | 4 ++-- lustre/osd-ldiskfs/osd_lproc.c | 2 +- lustre/osd-zfs/osd_lproc.c | 2 +- lustre/ptlrpc/nodemap_lproc.c | 2 +- lustre/ptlrpc/nrs_tbf.c | 6 +++--- lustre/quota/lquota_lib.c | 2 +- lustre/target/tgt_grant.c | 2 +- lustre/target/tgt_handler.c | 6 +++--- lustre/target/tgt_main.c | 1 + 29 files changed, 39 insertions(+), 37 deletions(-) diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index 4084da9..c967598 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -34,7 +34,7 @@ enum cfs_trace_buf_type { CFS_TCD_TYPE_CNT }; -union cfs_trace_data_union (*cfs_trace_data[CFS_TCD_TYPE_CNT])[NR_CPUS] __cacheline_aligned; +static union cfs_trace_data_union (*cfs_trace_data[CFS_TCD_TYPE_CNT])[NR_CPUS] __cacheline_aligned; /* Pages containing records already processed by daemon. * Link via ->lru, use size in ->private @@ -46,7 +46,7 @@ static long daemon_pages_max; char cfs_tracefile[TRACEFILE_NAME_SIZE]; long long cfs_tracefile_size = CFS_TRACEFILE_SIZE; -struct task_struct *tctl_task; +static struct task_struct *tctl_task; static atomic_t cfs_tage_allocated = ATOMIC_INIT(0); static DECLARE_RWSEM(cfs_tracefile_sem); diff --git a/lnet/lnet/lnet_rdma.c b/lnet/lnet/lnet_rdma.c index af5176c..b0eaad4 100644 --- a/lnet/lnet/lnet_rdma.c +++ b/lnet/lnet/lnet_rdma.c @@ -21,9 +21,9 @@ #define ERROR_PRINT_DEADLINE 3600 -atomic_t nvfs_shutdown = ATOMIC_INIT(1); -struct nvfs_dma_rw_ops *nvfs_ops = NULL; -struct percpu_counter nvfs_n_ops; +static atomic_t nvfs_shutdown = ATOMIC_INIT(1); +static struct nvfs_dma_rw_ops *nvfs_ops; +static struct percpu_counter nvfs_n_ops; static inline long nvfs_count_ops(void) { diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index eacd59d..786aedf 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -41,7 +41,7 @@ MODULE_PARM_DESC(ldlm_cpts, "CPU partitions ldlm threads should run on"); static DEFINE_MUTEX(ldlm_ref_mutex); static int ldlm_refcount; -struct kobject *ldlm_kobj; +static struct kobject *ldlm_kobj; struct kset *ldlm_ns_kset; struct kset *ldlm_svc_kset; diff --git a/lustre/lfsck/lfsck_namespace.c b/lustre/lfsck/lfsck_namespace.c index eef586b..49e60c2 100644 --- a/lustre/lfsck/lfsck_namespace.c +++ b/lustre/lfsck/lfsck_namespace.c @@ -6913,7 +6913,7 @@ out: EXIT; } -const struct lfsck_assistant_operations lfsck_namespace_assistant_ops = { +static const struct lfsck_assistant_operations lfsck_namespace_assistant_ops = { .la_handler_p1 = lfsck_namespace_assistant_handler_p1, .la_handler_p2 = lfsck_namespace_assistant_handler_p2, .la_fill_pos = lfsck_namespace_assistant_fill_pos, diff --git a/lustre/lmv/lproc_lmv.c b/lustre/lmv/lproc_lmv.c index 85acd1f..013ce6f 100644 --- a/lustre/lmv/lproc_lmv.c +++ b/lustre/lmv/lproc_lmv.c @@ -406,7 +406,7 @@ static const struct proc_ops lmv_proc_target_fops = { .proc_release = seq_release, }; -struct lprocfs_vars lprocfs_lmv_obd_vars[] = { +static struct lprocfs_vars lprocfs_lmv_obd_vars[] = { { .name = "qos_exclude_prefixes", .fops = &qos_exclude_prefixes_fops }, { .name = "target_obd", diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 07bd014..4d0cf09 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -157,7 +157,7 @@ int lod_fld_lookup(const struct lu_env *env, struct lod_device *lod, struct kmem_cache *lod_object_kmem; /* Slab for dt_txn_callback */ -struct kmem_cache *lod_txn_callback_kmem; +static struct kmem_cache *lod_txn_callback_kmem; static struct lu_kmem_descr lod_caches[] = { { .ckd_cache = &lod_object_kmem, diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index a471de7..f191749 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -569,7 +569,7 @@ LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, timeouts); LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, state); LDEBUGFS_SEQ_FOPS_RW_TYPE(mdc, import); -struct ldebugfs_vars ldebugfs_mdc_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_mdc_obd_vars[] = { { .name = "connect_flags", .fops = &mdc_connect_flags_fops }, { .name = "mds_server_uuid", diff --git a/lustre/mdc/mdc_batch.c b/lustre/mdc/mdc_batch.c index 1daa6fb..a10f5a1 100644 --- a/lustre/mdc/mdc_batch.c +++ b/lustre/mdc/mdc_batch.c @@ -186,7 +186,7 @@ out: return item->mop_cb(item, rc); } -object_update_interpret_t mdc_update_interpreters[MD_OP_MAX] = { +static object_update_interpret_t mdc_update_interpreters[MD_OP_MAX] = { [MD_OP_GETATTR] = mdc_batch_getattr_interpret, }; diff --git a/lustre/mdc/mdc_dev.c b/lustre/mdc/mdc_dev.c index 5990487..d064b6b 100644 --- a/lustre/mdc/mdc_dev.c +++ b/lustre/mdc/mdc_dev.c @@ -1669,7 +1669,7 @@ static int mdc_process_config(const struct lu_env *env, struct lu_device *d, return count > 0 ? 0 : count; } -const struct lu_device_operations mdc_lu_ops = { +static const struct lu_device_operations mdc_lu_ops = { .ldo_object_alloc = mdc_object_alloc, .ldo_process_config = mdc_process_config, .ldo_recovery_complete = NULL, diff --git a/lustre/mdt/mdt_mds.c b/lustre/mdt/mdt_mds.c index 3529d49..cbfaad0 100644 --- a/lustre/mdt/mdt_mds.c +++ b/lustre/mdt/mdt_mds.c @@ -60,7 +60,7 @@ module_param(mds_cpu_bind, uint, 0444); MODULE_PARM_DESC(mds_cpu_bind, "bind MDS threads to particular CPU partitions"); -int mds_max_io_threads = 512; +static int mds_max_io_threads = 512; module_param(mds_max_io_threads, int, 0444); MODULE_PARM_DESC(mds_max_io_threads, "maximum number of MDS IO service threads"); diff --git a/lustre/mgc/lproc_mgc.c b/lustre/mgc/lproc_mgc.c index 3490c64..bd6a3ee 100644 --- a/lustre/mgc/lproc_mgc.c +++ b/lustre/mgc/lproc_mgc.c @@ -36,7 +36,7 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void *v) LDEBUGFS_SEQ_FOPS_RO(mgc_ir_state); -struct ldebugfs_vars ldebugfs_mgc_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_mgc_obd_vars[] = { { .name = "connect_flags", .fops = &mgc_connect_flags_fops }, { .name = "mgs_server_uuid", diff --git a/lustre/obdclass/hash.c b/lustre/obdclass/hash.c index 24cc517..7c2a6cb 100644 --- a/lustre/obdclass/hash.c +++ b/lustre/obdclass/hash.c @@ -95,7 +95,7 @@ module_param(warn_on_depth, uint, 0644); MODULE_PARM_DESC(warn_on_depth, "warning when hash depth is high."); #endif -struct workqueue_struct *cfs_rehash_wq; +static struct workqueue_struct *cfs_rehash_wq; int cfs_hash_init(void) { diff --git a/lustre/obdclass/jobid.c b/lustre/obdclass/jobid.c index 38d5fef..faf218f 100644 --- a/lustre/obdclass/jobid.c +++ b/lustre/obdclass/jobid.c @@ -30,7 +30,7 @@ static struct cfs_hash *jobid_hash; static struct cfs_hash_ops jobid_hash_ops; -spinlock_t jobid_hash_lock; +static spinlock_t jobid_hash_lock; #define RESCAN_INTERVAL 30 #define DELETE_INTERVAL 300 diff --git a/lustre/obdclass/kernelcomm.c b/lustre/obdclass/kernelcomm.c index 06f7733..bdb2d4d 100644 --- a/lustre/obdclass/kernelcomm.c +++ b/lustre/obdclass/kernelcomm.c @@ -270,7 +270,7 @@ static int lustre_device_done(struct netlink_callback *cb) return 0; } -struct ln_key_list stats_params = { +static struct ln_key_list stats_params = { .lkl_maxattr = LUSTRE_PARAM_ATTR_MAX, .lkl_list = { [LUSTRE_PARAM_ATTR_HDR] = { diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 1a00a5e..259c1fc 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef CONFIG_PROC_FS diff --git a/lustre/obdclass/lprocfs_status_server.c b/lustre/obdclass/lprocfs_status_server.c index 683d0ab..07141fb 100644 --- a/lustre/obdclass/lprocfs_status_server.c +++ b/lustre/obdclass/lprocfs_status_server.c @@ -537,7 +537,7 @@ ldebugfs_nid_stats_clear_seq_write(struct file *file, const char __user *buffer, } EXPORT_SYMBOL(ldebugfs_nid_stats_clear_seq_write); -struct ldebugfs_vars ldebugfs_obd_exports_vars[] = { +static struct ldebugfs_vars ldebugfs_obd_exports_vars[] = { { .name = "nodemap", .fops = &ldebugfs_exp_nodemap_fops }, { .name = "uuid", diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index ef88dd0..b4cf710 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -1878,7 +1878,7 @@ static const struct rhashtable_params lu_env_rhash_params = { .head_offset = offsetof(struct lu_env_item, lei_linkage), }; -struct rhashtable lu_env_rhash; +static struct rhashtable lu_env_rhash; struct lu_env_percpu { struct task_struct *lep_task; diff --git a/lustre/obdclass/scrub.c b/lustre/obdclass/scrub.c index e417c7b..28488f2 100644 --- a/lustre/obdclass/scrub.c +++ b/lustre/obdclass/scrub.c @@ -461,7 +461,7 @@ void scrub_stop(struct lustre_scrub *scrub) } EXPORT_SYMBOL(scrub_stop); -const char *const scrub_status_names[] = { +static const char *const scrub_status_names[] = { "init", "scanning", "completed", @@ -472,7 +472,7 @@ const char *const scrub_status_names[] = { NULL }; -const char *const scrub_flags_names[] = { +static const char *const scrub_flags_names[] = { "recreated", "inconsistent", "auto", @@ -480,7 +480,7 @@ const char *const scrub_flags_names[] = { NULL }; -const char *const scrub_param_names[] = { +static const char *const scrub_param_names[] = { "failout", "dryrun", NULL diff --git a/lustre/ofd/ofd_oss.c b/lustre/ofd/ofd_oss.c index 218b51b..8ec8287 100644 --- a/lustre/ofd/ofd_oss.c +++ b/lustre/ofd/ofd_oss.c @@ -25,7 +25,7 @@ #define OSS_SERVICE_WATCHDOG_FACTOR 2 -int oss_max_threads = 512; +static int oss_max_threads = 512; module_param(oss_max_threads, int, 0444); MODULE_PARM_DESC(oss_max_threads, "maximum number of OSS service threads"); diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 6e7b4dc..29977a2 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -661,7 +661,7 @@ LDEBUGFS_SEQ_FOPS_RO_TYPE(osc, timeouts); LDEBUGFS_SEQ_FOPS_RO_TYPE(osc, state); LDEBUGFS_SEQ_FOPS_RW_TYPE(osc, import); -struct ldebugfs_vars ldebugfs_osc_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_osc_obd_vars[] = { { .name = "connect_flags", .fops = &osc_connect_flags_fops }, { .name = "ost_server_uuid", diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 06f82ad..4049cdd 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -80,13 +80,13 @@ atomic_t descriptors_cnt; unsigned int ldiskfs_flush_descriptors_cnt = 5000; /* 1 GiB in 512-byte sectors */ -int ldiskfs_delayed_unlink_blocks = (1 << (30 - 9)); +static int ldiskfs_delayed_unlink_blocks = (1 << (30 - 9)); /* Slab to allocate dynlocks */ struct kmem_cache *dynlock_cachep; /* Slab to allocate osd_it_ea */ -struct kmem_cache *osd_itea_cachep; +static struct kmem_cache *osd_itea_cachep; static struct lu_kmem_descr ldiskfs_caches[] = { { diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c index 618b3a5..f959100 100644 --- a/lustre/osd-ldiskfs/osd_lproc.c +++ b/lustre/osd-ldiskfs/osd_lproc.c @@ -807,7 +807,7 @@ static ssize_t extents_dense_store(struct kobject *kobj, struct attribute *attr, LUSTRE_RW_ATTR(extents_dense); #endif -struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { { .name = "oi_scrub", .fops = &ldiskfs_osd_oi_scrub_fops }, { NULL } diff --git a/lustre/osd-zfs/osd_lproc.c b/lustre/osd-zfs/osd_lproc.c index 79d031d..0e8703a 100644 --- a/lustre/osd-zfs/osd_lproc.c +++ b/lustre/osd-zfs/osd_lproc.c @@ -381,7 +381,7 @@ static struct attribute *zfs_attrs[] = { NULL, }; -struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { +static struct ldebugfs_vars ldebugfs_osd_obd_vars[] = { { .name = "oi_scrub", .fops = &zfs_osd_oi_scrub_fops }, { 0 } diff --git a/lustre/ptlrpc/nodemap_lproc.c b/lustre/ptlrpc/nodemap_lproc.c index eda3a3e..026c5b3 100644 --- a/lustre/ptlrpc/nodemap_lproc.c +++ b/lustre/ptlrpc/nodemap_lproc.c @@ -20,7 +20,7 @@ static LIST_HEAD(nodemap_pde_list); /* nodemap debugfs root directory under lustre */ -struct dentry *nodemap_root; +static struct dentry *nodemap_root; /** * Reads and prints the idmap for the given nodemap. diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 5b4112f..0f2316f 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -2281,7 +2281,7 @@ nrs_tbf_opcode_rule_dump(struct nrs_tbf_rule *rule, struct seq_file *m) } -struct nrs_tbf_ops nrs_tbf_opcode_ops = { +static struct nrs_tbf_ops nrs_tbf_opcode_ops = { .o_name = NRS_TBF_TYPE_OPCODE, .o_startup = nrs_tbf_opcode_startup, .o_cli_find = nrs_tbf_opcode_cli_find, @@ -2595,7 +2595,7 @@ static void nrs_tbf_id_rule_fini(struct nrs_tbf_rule *rule) OBD_FREE_STR(rule->tr_ids_str); } -struct nrs_tbf_ops nrs_tbf_uid_ops = { +static struct nrs_tbf_ops nrs_tbf_uid_ops = { .o_name = NRS_TBF_TYPE_UID, .o_startup = nrs_tbf_id_startup, .o_cli_find = nrs_tbf_id_cli_find, @@ -2608,7 +2608,7 @@ struct nrs_tbf_ops nrs_tbf_uid_ops = { .o_rule_fini = nrs_tbf_id_rule_fini, }; -struct nrs_tbf_ops nrs_tbf_gid_ops = { +static struct nrs_tbf_ops nrs_tbf_gid_ops = { .o_name = NRS_TBF_TYPE_GID, .o_startup = nrs_tbf_id_startup, .o_cli_find = nrs_tbf_id_cli_find, diff --git a/lustre/quota/lquota_lib.c b/lustre/quota/lquota_lib.c index 7dfe5eb..ad5ca57 100644 --- a/lustre/quota/lquota_lib.c +++ b/lustre/quota/lquota_lib.c @@ -20,7 +20,7 @@ struct kmem_cache *lqe_kmem; -struct lu_kmem_descr lquota_caches[] = { +static struct lu_kmem_descr lquota_caches[] = { { .ckd_cache = &lqe_kmem, .ckd_name = "lqe_kmem", diff --git a/lustre/target/tgt_grant.c b/lustre/target/tgt_grant.c index 0254c0a1..c4e6587 100644 --- a/lustre/target/tgt_grant.c +++ b/lustre/target/tgt_grant.c @@ -58,7 +58,7 @@ #include "tgt_internal.h" -int lbug_on_grant_miscount; +static int lbug_on_grant_miscount; module_param(lbug_on_grant_miscount, int, 0644); MODULE_PARM_DESC(lbug_on_grant_miscount, "LBUG on grant miscount"); diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 39e36b3..747dbd1 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1573,9 +1573,9 @@ void tgt_register_lfsck_in_notify_local(int (*notify)(const struct lu_env *, } EXPORT_SYMBOL(tgt_register_lfsck_in_notify_local); -int (*tgt_lfsck_in_notify)(const struct lu_env *env, - struct dt_device *key, - struct lfsck_request *lr) = NULL; +static int (*tgt_lfsck_in_notify)(const struct lu_env *env, + struct dt_device *key, + struct lfsck_request *lr) = NULL; void tgt_register_lfsck_in_notify(int (*notify)(const struct lu_env *, struct dt_device *, diff --git a/lustre/target/tgt_main.c b/lustre/target/tgt_main.c index 66071df..1665f2b 100644 --- a/lustre/target/tgt_main.c +++ b/lustre/target/tgt_main.c @@ -16,6 +16,7 @@ #include #include #include "tgt_internal.h" +#include "lu_target.h" #include "../ptlrpc/ptlrpc_internal.h" /* This must be longer than the longest string below */ -- 1.8.3.1