Whamcloud - gitweb
LU-17592 build: kernel 6.8 -Werror=missing-prototypes 28/54228/13
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 15 Apr 2024 18:29:30 +0000 (11:29 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Apr 2024 06:54:26 +0000 (06:54 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: Ice5219df5463effe964d2cd2114f003d185337da
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54228
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
29 files changed:
lnet/include/lnet/lnet_rdma.h
lnet/lnet/api-ni.c
lnet/lnet/lnet_rdma.c
lustre/autoconf/lustre-core.m4
lustre/include/cl_object.h
lustre/include/lustre_swab.h
lustre/include/obd_class.h
lustre/llite/vvp_internal.h
lustre/lod/lod_internal.h
lustre/lod/lod_pool.c
lustre/lov/lov_pack.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_hsm_cdt_requests.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/obdclass/genops.c
lustre/obdclass/llog_swab.c
lustre/obdclass/obd_mount.c
lustre/ofd/ofd_internal.h
lustre/osd-ldiskfs/osd_compat.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_iam.c
lustre/osd-ldiskfs/osd_iam_lvar.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/ptlrpc/llog_client.c
lustre/ptlrpc/nodemap_internal.h
lustre/ptlrpc/nodemap_storage.c
lustre/ptlrpc/pack_generic.c
lustre/quota/qsd_lib.c

index 64172de..a21d775 100644 (file)
@@ -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);
index ed1d157..8c12a8f 100644 (file)
@@ -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 */
index 671be86..c50eca9 100644 (file)
 /* MAX / MIN conflict */
 #include <lnet/lib-lnet.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)
-
 #define NVFS_IO_ERR                    -1
 #define NVFS_CPU_REQ                   -2
 
index dbaeea3..f2b1fa7 100644 (file)
@@ -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], [
index c5f8f47..19cd3b8 100644 (file)
@@ -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 */
index 75f8b8c..af839e1 100644 (file)
@@ -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);
index 0a6e03f..efe950d 100644 (file)
 #include <dt_object.h>
 #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 */
index e83c2e2..7541f49 100644 (file)
@@ -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);
index 412aef1..36552ec 100644 (file)
@@ -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);
index 96b1bcf..bd8c589 100644 (file)
@@ -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;
index 8f0a061..a33b13d 100644 (file)
@@ -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;
index 45d6aa0..43532bd 100644 (file)
@@ -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;
 
index 7c7880f..e09ab30 100644 (file)
@@ -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;
 
index 4657f52..631952d 100644 (file)
@@ -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);
index 8d0fd4e..f92e1e2 100644 (file)
@@ -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);
index b75aaaa..0e46ae7 100644 (file)
@@ -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)
 {
index d7d8bfc..a532276 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_LOG
 
-
 #include <lustre_log.h>
 #include <lustre_update.h>
 #include <llog_swab.h>
 
+#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)
 {
index c921a43..00c545f 100644 (file)
@@ -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.
index 688c332..a604347 100644 (file)
@@ -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);
index c4b8be9..0e72416 100644 (file)
@@ -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;
 
index 314aa79..a101ffb 100644 (file)
@@ -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;
index 373a1a7..12b23f5 100644 (file)
@@ -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.
index 41eb921..cff6e63 100644 (file)
@@ -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)
 {
index e6b71fb..e672c3f 100644 (file)
@@ -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);
index fa715aa..42be66a 100644 (file)
@@ -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)
index 18edead..933099a 100644 (file)
@@ -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 */
index e40f145..a25d00c 100644 (file)
@@ -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;
index 91cf24b..babc190 100644 (file)
@@ -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)
 {
index 130a311..c969067 100644 (file)
@@ -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
  */