From 7a97dae2027ac3d4286aca4a77d6dbe6d8737a35 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Thu, 28 Mar 2024 15:57:12 -0700 Subject: [PATCH] LU-8191 lustre: convert ec,fid,ldlm,quota functions to static 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 Change-Id: Ic64bdf0d802fd4c963b7b7d3a654575ebde5c07d Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54615 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/fid/fid_store.c | 6 +++--- lustre/ldlm/ldlm_lock.c | 2 +- lustre/ldlm/ldlm_request.c | 11 +++++++---- lustre/ldlm/ldlm_resource.c | 4 ++-- lustre/quota/qmt_lock.c | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index f2bb8f3..f0f15d8 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -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; diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index aaeb892..3e13e69 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -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); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 0670b15..301b5ce 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index c93c9b4..6cd2f80 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -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; diff --git a/lustre/quota/qmt_lock.c b/lustre/quota/qmt_lock.c index b690b13..7301b25 100644 --- a/lustre/quota/qmt_lock.c +++ b/lustre/quota/qmt_lock.c @@ -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; -- 1.8.3.1