Whamcloud - gitweb
LU-18753 ldlm: remove unused stub functions 64/58264/3
authorTimothy Day <timday@amazon.com>
Fri, 28 Feb 2025 06:27:50 +0000 (01:27 -0500)
committerOleg Drokin <green@whamcloud.com>
Mon, 31 Mar 2025 05:56:18 +0000 (05:56 +0000)
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 <timday@amazon.com>
Change-Id: Iff93740206b1cf295d4500c8135ea1d2343f4b66
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58264
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_request.c

index 6a5efa6..a1ec2cf 100644 (file)
@@ -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);
index f18c740..0cfe2c4 100644 (file)
@@ -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)
 {
index 15cbf5e..05e8449 100644 (file)
@@ -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.
  *
index ae6b50a..39cdc6f 100644 (file)
@@ -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)
 {
 }
index d141b79..d155ee6 100644 (file)
@@ -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.
  */