From 01e4c5066ca12221224d9ae34fd3568753062c8a Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Fri, 28 Feb 2025 01:27:50 -0500 Subject: [PATCH] LU-18753 ldlm: remove unused stub functions Remove: ldlm_lock_fail_match() ldlm_error2errno() ldlm_pool_get_clv() ldlm_pool_set_slv() ldlm_imp2pl() They are not called anywhere. Fixes: e536e511c9e6 ("LU-5829 ldlm: remove unnecessary EXPORT_SYMBOL") Fixes: fce887d1f9e0 ("b=15226") Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Iff93740206b1cf295d4500c8135ea1d2343f4b66 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58264 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/include/lustre_dlm.h | 6 +----- lustre/ldlm/ldlm_lib.c | 35 ----------------------------------- lustre/ldlm/ldlm_lock.c | 7 ------- lustre/ldlm/ldlm_pool.c | 36 ------------------------------------ lustre/ldlm/ldlm_request.c | 6 ------ 5 files changed, 1 insertion(+), 89 deletions(-) diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index 6a5efa6..a1ec2cf 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -1591,8 +1591,7 @@ static inline int ldlm_res_lvbo_update(struct ldlm_resource *res, int is_granted_or_cancelled_nolock(struct ldlm_lock *lock); int ldlm_error2errno(enum ldlm_error error); -/* don't call it `errno': this confuses user-space. */ -enum ldlm_error ldlm_errno2error(int err_no); + #if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks(struct obd_export *exp); #endif @@ -1621,7 +1620,6 @@ void ldlm_lock_decref(const struct lustre_handle *lockh, enum ldlm_mode mode); void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh, enum ldlm_mode mode); void ldlm_lock_fail_match_locked(struct ldlm_lock *lock); -void ldlm_lock_fail_match(struct ldlm_lock *lock); void ldlm_lock_allow_match(struct ldlm_lock *lock); void ldlm_lock_allow_match_locked(struct ldlm_lock *lock); @@ -1878,9 +1876,7 @@ int ldlm_pool_setup(struct ldlm_pool *pl, int limit); time64_t ldlm_pool_recalc(struct ldlm_pool *pl, bool force); __u32 ldlm_pool_get_lvf(struct ldlm_pool *pl); __u64 ldlm_pool_get_slv(struct ldlm_pool *pl); -__u64 ldlm_pool_get_clv(struct ldlm_pool *pl); __u32 ldlm_pool_get_limit(struct ldlm_pool *pl); -void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv); void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv); void ldlm_pool_set_limit(struct ldlm_pool *pl, __u32 limit); void ldlm_pool_add(struct ldlm_pool *pl, struct ldlm_lock *lock); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f18c740..0cfe2c4 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -3423,41 +3423,6 @@ int ldlm_error2errno(enum ldlm_error error) } EXPORT_SYMBOL(ldlm_error2errno); -/** - * Dual to ldlm_error2errno(): maps errno values back to enum ldlm_error. - */ -enum ldlm_error ldlm_errno2error(int err_no) -{ - int error; - - switch (err_no) { - case 0: - error = ELDLM_OK; - break; - case -ESTALE: - error = ELDLM_LOCK_CHANGED; - break; - case -ENAVAIL: - error = ELDLM_LOCK_ABORTED; - break; - case -ESRCH: - error = ELDLM_LOCK_REPLACED; - break; - case -ENOENT: - error = ELDLM_NO_LOCK_DATA; - break; - case -EEXIST: - error = ELDLM_NAMESPACE_EXISTS; - break; - case -EBADF: - error = ELDLM_BAD_NAMESPACE; - break; - default: - error = err_no; - } - return error; -} - #if LUSTRE_TRACKS_LOCK_EXP_REFS void ldlm_dump_export_locks(struct obd_export *exp) { diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 15cbf5e..05e8449 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -1347,13 +1347,6 @@ void ldlm_lock_fail_match_locked(struct ldlm_lock *lock) } EXPORT_SYMBOL(ldlm_lock_fail_match_locked); -void ldlm_lock_fail_match(struct ldlm_lock *lock) -{ - lock_res_and_lock(lock); - ldlm_lock_fail_match_locked(lock); - unlock_res_and_lock(lock); -} - /** * Mark lock as "matchable" by OST. * diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index ae6b50a..39cdc6f 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -1015,33 +1015,6 @@ __u64 ldlm_pool_get_slv(struct ldlm_pool *pl) } /** - * Sets passed \a slv to \a pl. - * - * \pre ->pl_lock is not locked. - */ -void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv) -{ - spin_lock(&pl->pl_lock); - pl->pl_server_lock_volume = slv; - spin_unlock(&pl->pl_lock); -} - -/** - * Returns current \a pl CLV. - * - * \pre ->pl_lock is not locked. - */ -__u64 ldlm_pool_get_clv(struct ldlm_pool *pl) -{ - __u64 slv; - - spin_lock(&pl->pl_lock); - slv = pl->pl_client_lock_volume; - spin_unlock(&pl->pl_lock); - return slv; -} - -/** * Sets passed \a clv to \a pl. * * \pre ->pl_lock is not locked. @@ -1518,15 +1491,6 @@ __u64 ldlm_pool_get_slv(struct ldlm_pool *pl) return 1; } -void ldlm_pool_set_slv(struct ldlm_pool *pl, __u64 slv) -{ -} - -__u64 ldlm_pool_get_clv(struct ldlm_pool *pl) -{ - return 1; -} - void ldlm_pool_set_clv(struct ldlm_pool *pl, __u64 clv) { } diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index d141b79..d155ee6 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -1502,12 +1502,6 @@ out: return rc ? : count; } -static inline struct ldlm_pool *ldlm_imp2pl(struct obd_import *imp) -{ - LASSERT(imp != NULL); - return &imp->imp_obd->obd_namespace->ns_pool; -} - /** * Update client's OBD pool related fields with new SLV and Limit from \a req. */ -- 1.8.3.1