Whamcloud - gitweb
LU-18136 ldlm: delete LDLM_LOCK_* macros from header 14/56014/5
authorTimothy Day <timday@amazon.com>
Tue, 13 Aug 2024 02:27:33 +0000 (22:27 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 2 Feb 2025 06:24:37 +0000 (06:24 +0000)
These macros are simply duplicates of the corresponding
ldlm_lock_* functions. Now that no code uses these,
remove them.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I72f562c4d9567e744e8dea7ae9fd836715c4f3eb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56014
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_lockd.c
lustre/mdc/mdc_locks.c

index c736dae..d7c9bb3 100644 (file)
@@ -1604,25 +1604,6 @@ enum ldlm_error ldlm_errno2error(int err_no);
 void ldlm_dump_export_locks(struct obd_export *exp);
 #endif
 
-/* Release temporary lock got by ldlm_handle2lock() or __ldlm_handle2lock() */
-#define LDLM_LOCK_PUT(lock)                     \
-do {                                            \
-       ldlm_lock_put(lock);                    \
-} while (0)
-
-/**
- * Release a lock reference obtained by some other means (see
- * LDLM_LOCK_PUT()).
- */
-#define LDLM_LOCK_RELEASE(lock) ldlm_lock_put(lock)
-
-#define LDLM_LOCK_GET(lock)                     \
-({                                              \
-       ldlm_lock_get(lock);                    \
-       /*LDLM_DEBUG((lock), "get");*/          \
-       lock;                                   \
-})
-
 #define ldlm_lock_list_put(head, member, count)                        \
 ({                                                             \
        struct ldlm_lock *_lock, *_next;                        \
@@ -1631,7 +1612,7 @@ do {                                            \
                if (c-- == 0)                                   \
                        break;                                  \
                list_del_init(&_lock->member);                  \
-               LDLM_LOCK_RELEASE(_lock);                       \
+               ldlm_lock_put(_lock);                           \
        }                                                       \
        LASSERT(c <= 0);                                        \
 })
index 14dd612..cc133be 100644 (file)
@@ -379,12 +379,12 @@ reprocess:
                                lock->l_flags |= LDLM_FL_AST_SENT;
                                ldlm_resource_unlink_lock(lock);
                                ldlm_add_ast_work_item(lock, NULL, &rpc_list);
-                               LDLM_LOCK_GET(lock);
+                               ldlm_lock_get(lock);
                                unlock_res_and_lock(req);
                                ldlm_run_ast_work(ns, &rpc_list,
                                                  LDLM_WORK_CP_AST);
                                ldlm_lock_cancel(lock);
-                               LDLM_LOCK_RELEASE(lock);
+                               ldlm_lock_put(lock);
                                lock_res_and_lock(req);
                                break;
                        }
index ba3ae64..686d848 100644 (file)
@@ -1794,7 +1794,7 @@ int ldlm_request_cancel(struct ptlrpc_request *req,
                if (lock->l_export != req->rq_export) {
                        LDLM_DEBUG_NOLOCK("server-side cancel mismatched export (cookie %llx)",
                                        dlm_req->lock_handle[i].cookie);
-                       LDLM_LOCK_PUT(lock);
+                       ldlm_lock_put(lock);
                        continue;
                }
 
index 7baba2a..d017b8c 100644 (file)
@@ -1212,7 +1212,7 @@ static int mdc_enqueue_async_interpret(const struct lu_env *env,
        rc = ldlm_cli_enqueue_fini(exp, &req->rq_pill, &einfo, 1,
                                  &mea->mea_flags, NULL, 0, &lockh, rc, true);
        if (rc == -ENOLCK)
-               LDLM_LOCK_RELEASE(lock);
+               ldlm_lock_put(lock);
 
        /* we expect failed_lock_cleanup() to destroy lock */
        if (rc != 0)
@@ -1221,7 +1221,7 @@ static int mdc_enqueue_async_interpret(const struct lu_env *env,
        if (mea->mea_upcall != NULL)
                mea->mea_upcall(lock, rc);
 
-       LDLM_LOCK_PUT(lock);
+       ldlm_lock_put(lock);
 
        RETURN(rc);
 }