Whamcloud - gitweb
LU-8191 lustre: convert ec,fid,ldlm,quota functions to static
authorTimothy Day <timday@amazon.com>
Thu, 28 Mar 2024 22:57:12 +0000 (15:57 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 30 Mar 2024 07:24:00 +0000 (07:24 +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.

Lustre-change: https://review.whamcloud.com/51476
Lustre-commit: bcc828bdf88f8a19e56535ff3840e06065b606b2

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ic64bdf0d802fd4c963b7b7d3a654575ebde5c07d
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54615
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
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 f2bb8f3..f0f15d8 100644 (file)
@@ -60,8 +60,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;
 
@@ -73,7 +73,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 aaeb892..3e13e69 100644 (file)
@@ -320,7 +320,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 0670b15..301b5ce 100644 (file)
@@ -94,7 +94,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;
 
@@ -109,7 +109,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;
@@ -267,7 +267,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;
@@ -2607,7 +2610,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 c93c9b4..6cd2f80 100644 (file)
@@ -722,13 +722,13 @@ static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
                lprocfs_free_stats(&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 b690b13..7301b25 100644 (file)
@@ -671,8 +671,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;