Whamcloud - gitweb
LU-8191 lustre: convert ec,fid,ldlm,quota functions to static 76/51476/4
authorTimothy Day <timday@amazon.com>
Fri, 23 Jun 2023 20:47:26 +0000 (20:47 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Jul 2023 03:08:50 +0000 (03:08 +0000)
Static analysis shows that a number of functions
could be made static. This patch declares several
functions in ec, fid, ldlm, and quota static.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ic64bdf0d802fd4c963b7b7d3a654575ebde5c07d
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51476
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ec/ec_base.c
lustre/fid/fid_store.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/quota/qmt_lock.c

index 9a280df..8e4e6db 100644 (file)
@@ -105,7 +105,7 @@ void ec_init_tables(int k, int rows, unsigned char *a, unsigned char *g_tbls)
 }
 EXPORT_SYMBOL(ec_init_tables);
 
-unsigned char gf_mul(unsigned char a, unsigned char b)
+static unsigned char gf_mul(unsigned char a, unsigned char b)
 {
        int i;
 
@@ -116,7 +116,7 @@ unsigned char gf_mul(unsigned char a, unsigned char b)
        return gff_base[i > 254 ? i - 255 : i];
 }
 
-unsigned char gf_inv(unsigned char a)
+static unsigned char gf_inv(unsigned char a)
 {
        if (a == 0)
                return 0;
index e73e849..547f92c 100644 (file)
@@ -59,8 +59,8 @@ struct seq_update_callback {
        struct lu_server_seq   *suc_seq;
 };
 
-void seq_update_cb(struct lu_env *env, struct thandle *th,
-                  struct dt_txn_commit_cb *cb, int err)
+static void seq_update_cb(struct lu_env *env, struct thandle *th,
+                         struct dt_txn_commit_cb *cb, int err)
 {
        struct seq_update_callback *ccb;
 
@@ -72,7 +72,7 @@ void seq_update_cb(struct lu_env *env, struct thandle *th,
        OBD_FREE_PTR(ccb);
 }
 
-int seq_update_cb_add(struct thandle *th, struct lu_server_seq *seq)
+static int seq_update_cb_add(struct thandle *th, struct lu_server_seq *seq)
 {
        struct seq_update_callback *ccb;
        struct dt_txn_commit_cb *dcb;
index 2c9bad9..00fcb77 100644 (file)
@@ -319,7 +319,7 @@ void ldlm_lock_add_to_lru_nolock(struct ldlm_lock *lock)
  * Adds LDLM lock \a lock to namespace LRU. Obtains necessary LRU locks
  * first.
  */
-void ldlm_lock_add_to_lru(struct ldlm_lock *lock)
+static void ldlm_lock_add_to_lru(struct ldlm_lock *lock)
 {
        struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
 
index f986c95..fcd94b9 100644 (file)
@@ -93,7 +93,7 @@ struct ldlm_async_args {
  *
  * \retval size of the request buffer
  */
-int ldlm_request_bufsize(int count, int type)
+static int ldlm_request_bufsize(int count, int type)
 {
        int avail = LDLM_LOCKREQ_HANDLES;
 
@@ -108,7 +108,7 @@ int ldlm_request_bufsize(int count, int type)
        return sizeof(struct ldlm_request) + avail;
 }
 
-void ldlm_expired_completion_wait(struct lock_wait_data *lwd)
+static void ldlm_expired_completion_wait(struct lock_wait_data *lwd)
 {
        struct ldlm_lock *lock = lwd->lwd_lock;
        struct obd_import *imp;
@@ -265,7 +265,10 @@ EXPORT_SYMBOL(ldlm_completion_ast_async);
 int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
 {
        /* XXX ALLOCATE - 160 bytes */
-       struct lock_wait_data lwd;
+       struct lock_wait_data lwd = {
+               .lwd_lock = NULL,
+               .lwd_conn_cnt = 0
+       };
        struct obd_device *obd;
        struct obd_import *imp = NULL;
        timeout_t timeout;
@@ -2663,7 +2666,7 @@ static int lock_can_replay(struct obd_import *imp)
               1 + min_t(u32, cli->cl_max_rpcs_in_flight, 8);
 }
 
-int __ldlm_replay_locks(struct obd_import *imp, bool rate_limit)
+static int __ldlm_replay_locks(struct obd_import *imp, bool rate_limit)
 {
        struct ldlm_namespace *ns = imp->imp_obd->obd_namespace;
        LIST_HEAD(list);
index e22bcb0..6fed024 100644 (file)
@@ -722,13 +722,13 @@ static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
                lprocfs_stats_free(&ns->ns_stats);
 }
 
-void ldlm_namespace_sysfs_unregister(struct ldlm_namespace *ns)
+static void ldlm_namespace_sysfs_unregister(struct ldlm_namespace *ns)
 {
        kobject_put(&ns->ns_kobj);
        wait_for_completion(&ns->ns_kobj_unregister);
 }
 
-int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)
+static int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)
 {
        int err;
 
index 67cd526..b7fd0e7 100644 (file)
@@ -635,8 +635,8 @@ again:
        RETURN(0);
 }
 
-void qmt_setup_id_desc(struct ldlm_lock *lock, union ldlm_gl_desc *desc,
-                      struct lquota_entry *lqe)
+static void qmt_setup_id_desc(struct ldlm_lock *lock, union ldlm_gl_desc *desc,
+                             struct lquota_entry *lqe)
 {
        struct obd_uuid *uuid = &(lock)->l_export->exp_client_uuid;
        int idx, stype;