From: Timothy Day Date: Tue, 13 Aug 2024 02:27:33 +0000 (-0400) Subject: LU-18136 ldlm: delete LDLM_LOCK_* macros from header X-Git-Tag: 2.16.52~47 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=54e304b9b52b1ca78d8b4a947cbba3f746489bdb;p=fs%2Flustre-release.git LU-18136 ldlm: delete LDLM_LOCK_* macros from header 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 Change-Id: I72f562c4d9567e744e8dea7ae9fd836715c4f3eb Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56014 Tested-by: Maloo Tested-by: jenkins Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_dlm.h b/lustre/include/lustre_dlm.h index c736dae..d7c9bb3 100644 --- a/lustre/include/lustre_dlm.h +++ b/lustre/include/lustre_dlm.h @@ -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); \ }) diff --git a/lustre/ldlm/ldlm_flock.c b/lustre/ldlm/ldlm_flock.c index 14dd612..cc133be 100644 --- a/lustre/ldlm/ldlm_flock.c +++ b/lustre/ldlm/ldlm_flock.c @@ -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; } diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index ba3ae64..686d848 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -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; } diff --git a/lustre/mdc/mdc_locks.c b/lustre/mdc/mdc_locks.c index 7baba2a..d017b8c 100644 --- a/lustre/mdc/mdc_locks.c +++ b/lustre/mdc/mdc_locks.c @@ -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); }