From bcc828bdf88f8a19e56535ff3840e06065b606b2 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Fri, 23 Jun 2023 20:47:26 +0000 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. Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Ic64bdf0d802fd4c963b7b7d3a654575ebde5c07d Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51476 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Arshad Hussain Reviewed-by: jsimmons Reviewed-by: Oleg Drokin --- lustre/ec/ec_base.c | 4 ++-- 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 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lustre/ec/ec_base.c b/lustre/ec/ec_base.c index 9a280df..8e4e6db 100644 --- a/lustre/ec/ec_base.c +++ b/lustre/ec/ec_base.c @@ -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; diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index e73e849..547f92c 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -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; diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 2c9bad9..00fcb77 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -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); diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index f986c95..fcd94b9 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -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); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index e22bcb0..6fed024e 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_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; diff --git a/lustre/quota/qmt_lock.c b/lustre/quota/qmt_lock.c index 67cd526..b7fd0e7 100644 --- a/lustre/quota/qmt_lock.c +++ b/lustre/quota/qmt_lock.c @@ -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; -- 1.8.3.1