From 1fc2e5644bfaa7b596c2664c757c8b157bcd3437 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Mon, 15 Apr 2024 11:29:30 -0700 Subject: [PATCH] LU-17592 build: kernel 6.8 -Werror=missing-prototypes Linux commit v6.7-rc4-156-g0fcb70851fbf Makefile.extrawarn: turn on missing-prototypes globally With -Wmissing-prototypes and -Werror cleanup some additional funtions that are implicitly static and provide declarations for those that are exported. Add SERVER_ONLY and SERVER_ONLY_EXPORT_SYMBOL to wrap functions that are only exported for and used by server components. Test-Parameters: trivial HPE-bug-id: LUS-12181 Signed-off-by: Shaun Tancheff Change-Id: Ice5219df5463effe964d2cd2114f003d185337da Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54228 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Timothy Day Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lnet/include/lnet/lnet_rdma.h | 16 +++++++++--- lnet/lnet/api-ni.c | 4 +-- lnet/lnet/lnet_rdma.c | 11 --------- lustre/autoconf/lustre-core.m4 | 9 +++++-- lustre/include/cl_object.h | 2 ++ lustre/include/lustre_swab.h | 2 ++ lustre/include/obd_class.h | 17 +++++++++++++ lustre/llite/vvp_internal.h | 2 -- lustre/lod/lod_internal.h | 1 - lustre/lod/lod_pool.c | 35 --------------------------- lustre/lov/lov_pack.c | 7 +++--- lustre/mdd/mdd_dir.c | 8 +++--- lustre/mdt/mdt_hsm_cdt_requests.c | 2 +- lustre/mdt/mdt_internal.h | 4 --- lustre/mdt/mdt_lproc.c | 7 +++--- lustre/obdclass/genops.c | 8 +++--- lustre/obdclass/llog_swab.c | 14 ++++++++--- lustre/obdclass/obd_mount.c | 13 ++++++---- lustre/ofd/ofd_internal.h | 3 --- lustre/osd-ldiskfs/osd_compat.c | 8 +++--- lustre/osd-ldiskfs/osd_handler.c | 26 ++++++++++---------- lustre/osd-ldiskfs/osd_iam.c | 51 --------------------------------------- lustre/osd-ldiskfs/osd_iam_lvar.c | 15 ------------ lustre/osd-ldiskfs/osd_lproc.c | 8 +++--- lustre/ptlrpc/llog_client.c | 4 +-- lustre/ptlrpc/nodemap_internal.h | 3 +++ lustre/ptlrpc/nodemap_storage.c | 6 ++--- lustre/ptlrpc/pack_generic.c | 4 +++ lustre/quota/qsd_lib.c | 2 -- 29 files changed, 111 insertions(+), 181 deletions(-) diff --git a/lnet/include/lnet/lnet_rdma.h b/lnet/include/lnet/lnet_rdma.h index 64172de..a21d775 100644 --- a/lnet/include/lnet/lnet_rdma.h +++ b/lnet/include/lnet/lnet_rdma.h @@ -5,6 +5,17 @@ #ifndef LNET_RDMA_H #define LNET_RDMA_H +#define REGSTR2(x) x##_register_nvfs_dma_ops +#define REGSTR(x) REGSTR2(x) + +#define UNREGSTR2(x) x##_unregister_nvfs_dma_ops +#define UNREGSTR(x) UNREGSTR2(x) + +#define MODULE_PREFIX lustre_v1 + +#define REGISTER_FUNC REGSTR(MODULE_PREFIX) +#define UNREGISTER_FUNC UNREGSTR(MODULE_PREFIX) + struct device; struct page; enum dma_data_direction; @@ -12,9 +23,8 @@ struct scatterlist; struct nvfs_dma_rw_ops; -int REGISTER_FUNC (struct nvfs_dma_rw_ops *ops); - -void UNREGISTER_FUNC (void); +int REGISTER_FUNC(struct nvfs_dma_rw_ops *ops); +void UNREGISTER_FUNC(void); unsigned int lnet_get_dev_prio(struct device *dev, unsigned int dev_idx); diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index ed1d157..8c12a8f 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -3921,7 +3921,7 @@ void lnet_mark_ping_buffer_for_update(void) } EXPORT_SYMBOL(lnet_mark_ping_buffer_for_update); -void lnet_update_ping_buffer(struct work_struct *work) +static void lnet_update_ping_buffer(struct work_struct *work) { struct lnet_ping_buffer *pbuf; struct lnet_handle_md ping_mdh; @@ -3937,11 +3937,9 @@ void lnet_update_ping_buffer(struct work_struct *work) false)) lnet_ping_target_update(pbuf, ping_mdh); - mutex_unlock(&the_lnet.ln_api_mutex); } - void lnet_queue_ping_buffer_update(void) { /* don't queue pb update if it is not needed */ diff --git a/lnet/lnet/lnet_rdma.c b/lnet/lnet/lnet_rdma.c index 671be86..c50eca91 100644 --- a/lnet/lnet/lnet_rdma.c +++ b/lnet/lnet/lnet_rdma.c @@ -14,17 +14,6 @@ /* MAX / MIN conflict */ #include -#define REGSTR2(x) x##_register_nvfs_dma_ops -#define REGSTR(x) REGSTR2(x) - -#define UNREGSTR2(x) x##_unregister_nvfs_dma_ops -#define UNREGSTR(x) UNREGSTR2(x) - -#define MODULE_PREFIX lustre_v1 - -#define REGISTER_FUNC REGSTR(MODULE_PREFIX) -#define UNREGISTER_FUNC UNREGSTR(MODULE_PREFIX) - #define NVFS_IO_ERR -1 #define NVFS_CPU_REQ -2 diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index dbaeea3..f2b1fa7 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2517,10 +2517,15 @@ AC_DEFUN([LC_SRC_INTERVAL_TREE_CACHED], [ #define START(n) ((n)->a) #define LAST(n) ((n)->b) struct rb_root_cached tree; + /* forward declare functions created by INTERVAL_TREE_DEFINE */ + void ftree_insert(struct foo *, struct rb_root_cached *); + void ftree_remove(struct foo *, struct rb_root_cached *); + struct foo *ftree_iter_first(struct rb_root_cached *, int, int); + struct foo *ftree_iter_next(struct foo *, int, int); INTERVAL_TREE_DEFINE(struct foo, rb, int, last, - START, LAST, , foo); + START, LAST, , ftree); ],[ - foo_insert(NULL, &tree); + ftree_insert(NULL, &tree); ],[-Werror]) ]) AC_DEFUN([LC_INTERVAL_TREE_CACHED], [ diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index c5f8f47..19cd3b8 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2616,4 +2616,6 @@ struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site, int cl_global_init(void); void cl_global_fini(void); +int lov_read_and_clear_async_rc(struct cl_object *clob); + #endif /* _LINUX_CL_OBJECT_H */ diff --git a/lustre/include/lustre_swab.h b/lustre/include/lustre_swab.h index 75f8b8c..af839e1 100644 --- a/lustre/include/lustre_swab.h +++ b/lustre/include/lustre_swab.h @@ -84,6 +84,8 @@ void lustre_swab_mdt_rec_setattr(struct mdt_rec_setattr *sa); void lustre_swab_mdt_rec_reint(struct mdt_rec_reint *rr); void lustre_swab_lmv_desc(struct lmv_desc *ld); void lustre_swab_lmv_mds_md(union lmv_mds_md *lmm); +void lustre_swab_lmv_user_md_objects(struct lmv_user_mds_data *lmd, + int stripe_count); void lustre_swab_lov_desc(struct lov_desc *ld); void lustre_swab_ldlm_res_id(struct ldlm_res_id *id); void lustre_swab_ldlm_policy_data(union ldlm_wire_policy_data *d); diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 0a6e03f..efe950d 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -33,6 +33,14 @@ #include #endif +#ifdef HAVE_SERVER_SUPPORT +#define SERVER_ONLY_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol) +#define SERVER_ONLY +#else +#define SERVER_ONLY static +#define SERVER_ONLY_EXPORT_SYMBOL(symbol) +#endif + #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay * and resends for avoid deadlocks */ #define OBD_STATFS_FROM_CACHE 0x0002 /* the statfs callback should not update @@ -181,6 +189,10 @@ struct cfg_interop_param { char *new_param; }; +#ifdef HAVE_SERVER_SUPPORT +void lustre_register_quota_process_config(int (*qpc)(struct lustre_cfg *lcfg)); +#endif + char *lustre_cfg_string(struct lustre_cfg *lcfg, u32 index); struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg, const char *new_name); @@ -2141,4 +2153,9 @@ int obd_ioctl_msg(const char *file, const char *func, int line, int level, #define OBD_IOC_ERROR(dev, cmd, msg, rc) \ obd_ioctl_msg(__FILE__, __func__, __LINE__, D_ERROR, dev, cmd, msg, rc) +/* ldlm/ldlm_lib.c */ +void target_recovery_fini(struct obd_device *obd); +void target_recovery_init(struct lu_target *lut, svc_handler_t handler); + + #endif /* __LINUX_OBD_CLASS_H */ diff --git a/lustre/llite/vvp_internal.h b/lustre/llite/vvp_internal.h index e83c2e2..7541f49 100644 --- a/lustre/llite/vvp_internal.h +++ b/lustre/llite/vvp_internal.h @@ -263,8 +263,6 @@ struct vvp_object *cl_inode2vvp(struct inode *inode); ((void)sizeof(env), (void)sizeof(clob), (void)sizeof !!(expr)) #endif /* CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */ -int lov_read_and_clear_async_rc(struct cl_object *clob); - int vvp_io_init(const struct lu_env *env, struct cl_object *obj, struct cl_io *io); int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io); diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h index 412aef1..36552ec 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h @@ -657,7 +657,6 @@ int lod_sub_init_llog(const struct lu_env *env, struct lod_device *lod, void lod_sub_fini_llog(const struct lu_env *env, struct dt_device *dt, struct task_struct **taskp); int lodname2mdt_index(char *lodname, __u32 *mdt_index); -extern void target_recovery_fini(struct obd_device *obd); /* lod_lov.c */ void lod_getref(struct lod_tgt_descs *ltd); diff --git a/lustre/lod/lod_pool.c b/lustre/lod/lod_pool.c index 96b1bcf..bd8c589 100644 --- a/lustre/lod/lod_pool.c +++ b/lustre/lod/lod_pool.c @@ -331,41 +331,6 @@ const static struct proc_ops pool_proc_operations = { .proc_release = seq_release, }; -/** - * Dump the pool target list into the Lustre debug log. - * - * This is a debugging function to allow dumping the list of targets - * in \a pool to the Lustre kernel debug log at the given \a level. - * - * This is not currently called by any existing code, but can be called - * from within gdb/crash to display the contents of the pool, or from - * code under development. - * - * \param[in] level Lustre debug level (D_INFO, D_WARN, D_ERROR, etc) - * \param[in] pool pool descriptor to be dumped - */ -void lod_dump_pool(int level, struct lod_pool_desc *pool) -{ - unsigned int i; - - pool_getref(pool); - - CDEBUG(level, "pool "LOV_POOLNAMEF" has %d members\n", - pool->pool_name, pool->pool_obds.op_count); - down_read(&pool_tgt_rw_sem(pool)); - - for (i = 0; i < pool_tgt_count(pool) ; i++) { - if (!pool_tgt(pool, i) || !(pool_tgt(pool, i))->ltd_exp) - continue; - CDEBUG(level, "pool "LOV_POOLNAMEF"[%d] = %s\n", - pool->pool_name, i, - obd_uuid2str(&((pool_tgt(pool, i))->ltd_uuid))); - } - - up_read(&pool_tgt_rw_sem(pool)); - lod_pool_putref(pool); -} - static void pools_hash_exit(void *vpool, void *data) { struct lod_pool_desc *pool = vpool; diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 8f0a061..a33b13d 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -182,7 +182,8 @@ static ssize_t lov_lsm_pack_foreign(const struct lov_stripe_md *lsm, void *buf, RETURN(lfm_size); } -unsigned int lov_lsme_pack_foreign(struct lov_stripe_md_entry *lsme, void *lmm) +static unsigned int lov_lsme_pack_foreign(struct lov_stripe_md_entry *lsme, + void *lmm) { struct lov_foreign_md *lfm = (struct lov_foreign_md *)lmm; @@ -198,8 +199,8 @@ unsigned int lov_lsme_pack_foreign(struct lov_stripe_md_entry *lsme, void *lmm) return lov_foreign_md_size(lsme->lsme_length); } -unsigned int lov_lsme_pack_v1v3(struct lov_stripe_md_entry *lsme, - struct lov_mds_md *lmm) +static unsigned int lov_lsme_pack_v1v3(struct lov_stripe_md_entry *lsme, + struct lov_mds_md *lmm) { struct lov_ost_data_v1 *lmm_objects; __u16 stripe_count; diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index 45d6aa0..43532bd 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -1112,9 +1112,11 @@ void mdd_changelog_rec_extra_xattr(struct changelog_rec *rec, * \retval 0 success * \retval -errno failure */ -int mdd_changelog_ns_pfid_set(const struct lu_env *env, struct mdd_device *mdd, - struct mdd_object *parent, - const struct lu_attr *pattr, struct lu_fid *pfid) +static int mdd_changelog_ns_pfid_set(const struct lu_env *env, + struct mdd_device *mdd, + struct mdd_object *parent, + const struct lu_attr *pattr, + struct lu_fid *pfid) { int rc = 0; diff --git a/lustre/mdt/mdt_hsm_cdt_requests.c b/lustre/mdt/mdt_hsm_cdt_requests.c index 7c7880f..e09ab30 100644 --- a/lustre/mdt/mdt_hsm_cdt_requests.c +++ b/lustre/mdt/mdt_hsm_cdt_requests.c @@ -279,7 +279,7 @@ void mdt_cdt_get_request(struct cdt_agent_req *car) kref_get(&car->car_refcount); } -void mdt_cdt_put_request_free(struct kref *kref) +static void mdt_cdt_put_request_free(struct kref *kref) { struct cdt_agent_req *car; diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index 4657f52..631952d 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -919,10 +919,6 @@ void mdt_reconstruct(struct mdt_thread_info *, struct mdt_lock_handle *); void mdt_reconstruct_generic(struct mdt_thread_info *mti, struct mdt_lock_handle *lhc); -extern void target_recovery_fini(struct obd_device *obd); -extern void target_recovery_init(struct lu_target *lut, - svc_handler_t handler); - int mdt_export_stats_init(struct obd_device *obd, struct obd_export *exp, void *client_nid); diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 8d0fd4e..f92e1e2 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -1186,7 +1186,8 @@ static int mdt_checksum_type_seq_show(struct seq_file *m, void *data) return 0; } -ssize_t job_xattr_show(struct kobject *kobj, struct attribute *attr, char *buf) +static ssize_t job_xattr_show(struct kobject *kobj, struct attribute *attr, + char *buf) { struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); @@ -1208,8 +1209,8 @@ ssize_t job_xattr_show(struct kobject *kobj, struct attribute *attr, char *buf) * * @return -EINVAL if the name is invalid, else count */ -ssize_t job_xattr_store(struct kobject *kobj, struct attribute *attr, - const char *buffer, size_t count) +static ssize_t job_xattr_store(struct kobject *kobj, struct attribute *attr, + const char *buffer, size_t count) { struct obd_device *obd = container_of(kobj, struct obd_device, obd_kset.kobj); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index b75aaaa..0e46ae7 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -88,7 +88,7 @@ static void obd_device_free(struct obd_device *obd) OBD_SLAB_FREE_PTR(obd, obd_device_cachep); } -struct obd_type *class_search_type(const char *name) +SERVER_ONLY struct obd_type *class_search_type(const char *name) { struct kobject *kobj = kset_find_obj(lustre_kset, name); @@ -98,9 +98,9 @@ struct obd_type *class_search_type(const char *name) kobject_put(kobj); return NULL; } -EXPORT_SYMBOL(class_search_type); +SERVER_ONLY_EXPORT_SYMBOL(class_search_type); -struct obd_type *class_get_type(const char *name) +SERVER_ONLY struct obd_type *class_get_type(const char *name) { struct obd_type *type; @@ -155,7 +155,7 @@ struct obd_type *class_get_type(const char *name) rcu_read_unlock(); return type; } -EXPORT_SYMBOL(class_get_type); +SERVER_ONLY_EXPORT_SYMBOL(class_get_type); void class_put_type(struct obd_type *type) { diff --git a/lustre/obdclass/llog_swab.c b/lustre/obdclass/llog_swab.c index d7d8bfc..a532276 100644 --- a/lustre/obdclass/llog_swab.c +++ b/lustre/obdclass/llog_swab.c @@ -37,11 +37,18 @@ #define DEBUG_SUBSYSTEM S_LOG - #include #include #include +#ifdef HAVE_SERVER_SUPPORT +#define SERVER_ONLY_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL(symbol) +#define SERVER_ONLY +#else +#define SERVER_ONLY static +#define SERVER_ONLY_EXPORT_SYMBOL(symbol) +#endif + static void print_llogd_body(struct llogd_body *d) { CDEBUG(D_OTHER, "llogd body: %p\n", d); @@ -124,7 +131,8 @@ void lustre_swab_lu_seq_range(struct lu_seq_range *range) } EXPORT_SYMBOL(lustre_swab_lu_seq_range); -void lustre_swab_update_ops(struct update_ops *uops, unsigned int op_count) +SERVER_ONLY void lustre_swab_update_ops(struct update_ops *uops, + unsigned int op_count) { unsigned int i; unsigned int j; @@ -137,7 +145,7 @@ void lustre_swab_update_ops(struct update_ops *uops, unsigned int op_count) __swab16s(&uops->uops_op[i].uop_params_off[j]); } } -EXPORT_SYMBOL(lustre_swab_update_ops); +SERVER_ONLY_EXPORT_SYMBOL(lustre_swab_update_ops); void lustre_swab_llog_rec(struct llog_rec_hdr *rec) { diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index c921a43..00c545f 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -198,6 +198,7 @@ static int do_lcfg_nid(char *cfgname, struct lnet_nid *nid, int cmd, * Call class_attach and class_setup. These methods in turn call * OBD type-specific methods. */ +SERVER_ONLY int lustre_start_simple(char *obdname, char *type, char *uuid, char *s1, char *s2, char *s3, char *s4) { @@ -217,7 +218,7 @@ int lustre_start_simple(char *obdname, char *type, char *uuid, } return rc; } -EXPORT_SYMBOL(lustre_start_simple); +SERVER_ONLY_EXPORT_SYMBOL(lustre_start_simple); static DEFINE_MUTEX(mgc_start_lock); @@ -520,7 +521,7 @@ out_free: } EXPORT_SYMBOL(lustre_start_mgc); -int lustre_stop_mgc(struct super_block *sb) +SERVER_ONLY int lustre_stop_mgc(struct super_block *sb) { struct lustre_sb_info *lsi = s2lsi(sb); struct obd_device *obd; @@ -588,7 +589,7 @@ out: mutex_unlock(&mgc_start_lock); RETURN(rc); } -EXPORT_SYMBOL(lustre_stop_mgc); +SERVER_ONLY_EXPORT_SYMBOL(lustre_stop_mgc); /***************** lustre superblock **************/ @@ -857,6 +858,7 @@ int server_name2svname(const char *label, char *svname, const char **endptr, EXPORT_SYMBOL(server_name2svname); #endif /* HAVE_SERVER_SUPPORT */ +#ifdef HAVE_SERVER_SUPPORT /** * check server name is OST. **/ @@ -877,12 +879,13 @@ int server_name_is_ost(const char *svname) return 0; } EXPORT_SYMBOL(server_name_is_ost); +#endif /* HAVE_SERVER_SUPPORT */ /** * Get the index from the target name MDTXXXX/OSTXXXX * rc = server type, or rc < 0 on error **/ -int target_name2index(const char *tgtname, u32 *idx, const char **endptr) +SERVER_ONLY int target_name2index(const char *tgtname, u32 *idx, const char **endptr) { const char *dash = tgtname; int type, len, rc; @@ -929,7 +932,7 @@ int target_name2index(const char *tgtname, u32 *idx, const char **endptr) return type; } -EXPORT_SYMBOL(target_name2index); +SERVER_ONLY_EXPORT_SYMBOL(target_name2index); /* * Get the index from the OBD name. diff --git a/lustre/ofd/ofd_internal.h b/lustre/ofd/ofd_internal.h index 688c332..a604347 100644 --- a/lustre/ofd/ofd_internal.h +++ b/lustre/ofd/ofd_internal.h @@ -293,9 +293,6 @@ struct ofd_thread_info { }; }; -extern void target_recovery_fini(struct obd_device *obd); -extern void target_recovery_init(struct lu_target *lut, svc_handler_t handler); - /* ofd_access_log.c */ bool ofd_access_log_size_is_valid(unsigned int size); int ofd_access_log_module_init(void); diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index c4b8be9..0e72416 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -69,10 +69,10 @@ static void osd_push_ctxt(const struct osd_device *dev, push_ctxt(save, newctxt); } -struct dentry *osd_lookup_one_len_common(struct osd_device *dev, - const char *name, - struct dentry *base, int len, - enum oi_check_flags flags) +static struct dentry *osd_lookup_one_len_common(struct osd_device *dev, + const char *name, + struct dentry *base, int len, + enum oi_check_flags flags) { struct dentry *dchild; diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 314aa79..a101ffb 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -1848,7 +1848,7 @@ bool osd_tx_was_declared(const struct lu_env *env, struct osd_thandle *oth, return false; } -void osd_tx_declaration_free(struct osd_thandle *oth) +static void osd_tx_declaration_free(struct osd_thandle *oth) { struct osd_obj_declare *old, *tmp; @@ -2007,17 +2007,17 @@ void osd_trans_dump_creds(const struct lu_env *env, struct thandle *th) } #ifdef HAVE_LDISKFS_JOURNAL_ENSURE_CREDITS -void osd_ldiskfs_credits_for_revoke(struct osd_device *osd, - struct osd_thandle *oh, - int *credits, int *revoke) +static void osd_ldiskfs_credits_for_revoke(struct osd_device *osd, + struct osd_thandle *oh, + int *credits, int *revoke) { int blocks = LDISKFS_MAX_EXTENT_DEPTH * oh->oh_declared_ext; *revoke += ldiskfs_trans_default_revoke_credits(osd_sb(osd)) + blocks; } #else -void osd_ldiskfs_credits_for_revoke(struct osd_device *osd, - struct osd_thandle *oh, - int *credits, int *revoke) +static void osd_ldiskfs_credits_for_revoke(struct osd_device *osd, + struct osd_thandle *oh, + int *credits, int *revoke) { struct journal_s *journal = LDISKFS_SB(osd_sb(osd))->s_journal; int blocks, jbsize, records_per_block; @@ -2320,8 +2320,8 @@ static void osd_delayed_iput_fn(struct work_struct *work) OBD_FREE_PTR(diwork); } -noinline void osd_delayed_iput(struct inode *inode, - struct osd_delayed_iput_work *diwork) +noinline static void osd_delayed_iput(struct inode *inode, + struct osd_delayed_iput_work *diwork) { if (!diwork) { iput(inode); @@ -7948,7 +7948,7 @@ static int osd_it_ea_load(const struct lu_env *env, RETURN(rc); } -int osd_olc_lookup(const struct lu_env *env, struct osd_object *obj, +static int osd_olc_lookup(const struct lu_env *env, struct osd_object *obj, u64 iversion, struct dt_rec *rec, const struct lu_name *ln, int *result) { @@ -7996,9 +7996,9 @@ int osd_olc_lookup(const struct lu_env *env, struct osd_object *obj, return 0; } -void osd_olc_save(const struct lu_env *env, struct osd_object *obj, - struct dt_rec *rec, const struct lu_name *ln, - const int result, u64 iversion) +static void osd_olc_save(const struct lu_env *env, struct osd_object *obj, + struct dt_rec *rec, const struct lu_name *ln, + const int result, u64 iversion) { struct osd_thread_info *oti = osd_oti_get(env); struct osd_lookup_cache_entry *entry; diff --git a/lustre/osd-ldiskfs/osd_iam.c b/lustre/osd-ldiskfs/osd_iam.c index 373a1a7..12b23f5 100644 --- a/lustre/osd-ldiskfs/osd_iam.c +++ b/lustre/osd-ldiskfs/osd_iam.c @@ -2414,57 +2414,6 @@ static inline int ptr_inside(void *base, size_t size, void *ptr) return (base <= ptr) && (ptr < base + size); } -static int iam_frame_invariant(struct iam_frame *f) -{ - return - (f->bh != NULL && - f->bh->b_data != NULL && - ptr_inside(f->bh->b_data, f->bh->b_size, f->entries) && - ptr_inside(f->bh->b_data, f->bh->b_size, f->at) && - f->entries <= f->at); -} - -static int iam_leaf_invariant(struct iam_leaf *l) -{ - return - l->il_bh != NULL && - l->il_bh->b_data != NULL && - ptr_inside(l->il_bh->b_data, l->il_bh->b_size, l->il_entries) && - ptr_inside(l->il_bh->b_data, l->il_bh->b_size, l->il_at) && - l->il_entries <= l->il_at; -} - -static int iam_path_invariant(struct iam_path *p) -{ - int i; - - if (p->ip_container == NULL || - p->ip_indirect < 0 || p->ip_indirect > DX_MAX_TREE_HEIGHT - 1 || - p->ip_frame != p->ip_frames + p->ip_indirect || - !iam_leaf_invariant(&p->ip_leaf)) - return 0; - for (i = 0; i < ARRAY_SIZE(p->ip_frames); ++i) { - if (i <= p->ip_indirect) { - if (!iam_frame_invariant(&p->ip_frames[i])) - return 0; - } - } - return 1; -} - -int iam_it_invariant(struct iam_iterator *it) -{ - return - (it->ii_state == IAM_IT_DETACHED || - it->ii_state == IAM_IT_ATTACHED || - it->ii_state == IAM_IT_SKEWED) && - !(it->ii_flags & ~(IAM_IT_MOVE | IAM_IT_WRITE)) && - ergo(it->ii_state == IAM_IT_ATTACHED || - it->ii_state == IAM_IT_SKEWED, - iam_path_invariant(&it->ii_path) && - equi(it_at_rec(it), it->ii_state == IAM_IT_SKEWED)); -} - /* * Search container @c for record with key @k. If record is found, its data * are moved into @r. diff --git a/lustre/osd-ldiskfs/osd_iam_lvar.c b/lustre/osd-ldiskfs/osd_iam_lvar.c index 41eb921..cff6e63 100644 --- a/lustre/osd-ldiskfs/osd_iam_lvar.c +++ b/lustre/osd-ldiskfs/osd_iam_lvar.c @@ -148,12 +148,6 @@ static inline lvar_hash_t e_hash(const struct lvar_leaf_entry *ent) return le32_to_cpu(ent->vle_hash); } -static void e_print(const struct lvar_leaf_entry *ent) -{ - CERROR(" %p %8.8x \"%*.*s\"\n", ent, e_hash(ent), - e_keysize(ent), e_keysize(ent), e_char(ent)); -} - static inline struct lvar_leaf_entry *e_next(const struct iam_leaf *leaf, const struct lvar_leaf_entry *ent) { @@ -287,15 +281,6 @@ static struct lvar_leaf_entry *n_cur(const struct iam_leaf *l) return lentry_lvar(l->il_at); } -void n_print(const struct iam_leaf *l) -{ - struct lvar_leaf_entry *scan; - - CERROR("used: %d\n", h_used(n_head(l))); - for (scan = n_start(l); scan < n_end(l); scan = e_next(l, scan)) - e_print(scan); -} - #if LDISKFS_CORRECTNESS_ON static int n_at_rec(const struct iam_leaf *folio) { diff --git a/lustre/osd-ldiskfs/osd_lproc.c b/lustre/osd-ldiskfs/osd_lproc.c index e6b71fb..e672c3f 100644 --- a/lustre/osd-ldiskfs/osd_lproc.c +++ b/lustre/osd-ldiskfs/osd_lproc.c @@ -329,8 +329,8 @@ static ssize_t fallocate_zero_blocks_store(struct kobject *kobj, } LUSTRE_RW_ATTR(fallocate_zero_blocks); -ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr, - const char *buffer, size_t count) +static ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr, + const char *buffer, size_t count) { struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj); struct osd_device *osd = osd_dt_dev(dt); @@ -783,8 +783,8 @@ static ssize_t index_backup_show(struct kobject *kobj, struct attribute *attr, return sprintf(buf, "%d\n", dev->od_index_backup_policy); } -ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr, - const char *buffer, size_t count) +static ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr, + const char *buffer, size_t count) { struct dt_device *dt = container_of(kobj, struct dt_device, dd_kobj); diff --git a/lustre/ptlrpc/llog_client.c b/lustre/ptlrpc/llog_client.c index fa715aa..42be66a 100644 --- a/lustre/ptlrpc/llog_client.c +++ b/lustre/ptlrpc/llog_client.c @@ -46,7 +46,7 @@ #include "ptlrpc_internal.h" -struct obd_import *llog_client_entry(struct llog_ctxt *ctxt) +static struct obd_import *llog_client_entry(struct llog_ctxt *ctxt) { struct obd_import *imp = ERR_PTR(-EINVAL); @@ -62,7 +62,7 @@ struct obd_import *llog_client_entry(struct llog_ctxt *ctxt) return imp; } -void llog_client_exit(struct llog_ctxt *ctxt, struct obd_import *imp) +static void llog_client_exit(struct llog_ctxt *ctxt, struct obd_import *imp) { mutex_lock(&ctxt->loc_mutex); if (ctxt->loc_imp != imp) diff --git a/lustre/ptlrpc/nodemap_internal.h b/lustre/ptlrpc/nodemap_internal.h index 18edead..933099a 100644 --- a/lustre/ptlrpc/nodemap_internal.h +++ b/lustre/ptlrpc/nodemap_internal.h @@ -166,4 +166,7 @@ int nodemap_idx_idmap_del(const struct lu_nodemap *nodemap, int nodemap_idx_range_add(const struct lu_nid_range *range); int nodemap_idx_range_del(const struct lu_nid_range *range); int nodemap_idx_nodemap_activate(bool value); +int nodemap_index_read(struct lu_env *env, struct nm_config_file *ncf, + struct idx_info *ii, const struct lu_rdpg *rdpg); + #endif /* _NODEMAP_INTERNAL_H */ diff --git a/lustre/ptlrpc/nodemap_storage.c b/lustre/ptlrpc/nodemap_storage.c index e40f145b..a25d00c 100644 --- a/lustre/ptlrpc/nodemap_storage.c +++ b/lustre/ptlrpc/nodemap_storage.c @@ -1620,10 +1620,8 @@ out: return rc; } -int nodemap_index_read(struct lu_env *env, - struct nm_config_file *ncf, - struct idx_info *ii, - const struct lu_rdpg *rdpg) +int nodemap_index_read(struct lu_env *env, struct nm_config_file *ncf, + struct idx_info *ii, const struct lu_rdpg *rdpg) { struct dt_object *nodemap_idx = ncf->ncf_obj; __u64 version; diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 91cf24b..babc190 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1952,6 +1952,7 @@ void lustre_swab_generic_32s(__u32 *val) __swab32s(val); } +#ifdef HAVE_SERVER_SUPPORT void lustre_swab_gl_lquota_desc(struct ldlm_gl_lquota_desc *desc) { lustre_swab_lu_fid(&desc->gl_id.qid_fid); @@ -1971,6 +1972,7 @@ void lustre_swab_gl_barrier_desc(struct ldlm_gl_barrier_desc *desc) BUILD_BUG_ON(offsetof(typeof(*desc), lgbd_padding) == 0); } EXPORT_SYMBOL(lustre_swab_gl_barrier_desc); +#endif /* HAVE_SERVER_SUPPORT */ void lustre_swab_ost_lvb_v1(struct ost_lvb_v1 *lvb) { @@ -3111,6 +3113,7 @@ void lustre_swab_lfsck_reply(struct lfsck_reply *lr) __swab64s(&lr->lr_repaired); } +#ifdef HAVE_SERVER_SUPPORT static void lustre_swab_orphan_rec(struct lu_orphan_rec *rec) { lustre_swab_lu_fid(&rec->lor_fid); @@ -3145,6 +3148,7 @@ void lustre_swab_orphan_ent_v3(struct lu_orphan_ent_v3 *ent) BUILD_BUG_ON(offsetof(typeof(ent->loe_rec), lor_padding_2) == 0); } EXPORT_SYMBOL(lustre_swab_orphan_ent_v3); +#endif /* HAVE_SERVER_SUPPORT */ void lustre_swab_ladvise(struct lu_ladvise *ladvise) { diff --git a/lustre/quota/qsd_lib.c b/lustre/quota/qsd_lib.c index 130a311..c969067 100644 --- a/lustre/quota/qsd_lib.c +++ b/lustre/quota/qsd_lib.c @@ -944,8 +944,6 @@ int qsd_start(const struct lu_env *env, struct qsd_instance *qsd) } EXPORT_SYMBOL(qsd_start); -void lustre_register_quota_process_config(int (*qpc)(struct lustre_cfg *lcfg)); - /* * Global initialization performed at module load time */ -- 1.8.3.1