From 475a1ba0769c96c20024b62fc32e02064e534cec Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Thu, 19 Dec 2024 23:12:17 -0500 Subject: [PATCH] LU-16565 target: Remove ldlm is,set,clear macros Replaces ldlm_{is,set,clear} macros with the direct flag names. The patch has been generated with the coccinelle script in contrib/cocci/ldlm_flags.cocci. Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: I63198e3278d9be930c768b64ffdccc9cd1e74a76 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57542 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/target/tgt_handler.c | 2 +- lustre/target/tgt_main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index f864d46..ce8e9b9 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -1364,7 +1364,7 @@ int tgt_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, (lock->l_granted_mode & (LCK_EX | LCK_PW | LCK_GROUP)) && (tgt->lut_sync_lock_cancel == SYNC_LOCK_CANCEL_ALWAYS || (tgt->lut_sync_lock_cancel == SYNC_LOCK_CANCEL_BLOCKING && - ldlm_is_cbpending(lock))) && + (lock->l_flags & LDLM_FL_CBPENDING))) && ((exp_connect_flags(lock->l_export) & OBD_CONNECT_MDS_MDS) || lock->l_resource->lr_type == LDLM_EXTENT)) { __u64 start = 0; diff --git a/lustre/target/tgt_main.c b/lustre/target/tgt_main.c index b8cfa24..66071df 100644 --- a/lustre/target/tgt_main.c +++ b/lustre/target/tgt_main.c @@ -360,7 +360,7 @@ void tgt_save_slc_lock(struct lu_target *lut, struct ldlm_lock *lock, { spin_lock(&lut->lut_slc_locks_guard); lock_res_and_lock(lock); - if (ldlm_is_cbpending(lock)) { + if ((lock->l_flags & LDLM_FL_CBPENDING)) { /* if it was canceld by server, don't save, because remote MDT * will do Sync-on-Cancel. */ ldlm_lock_put(lock); @@ -395,7 +395,7 @@ void tgt_discard_slc_lock(struct lu_target *lut, struct ldlm_lock *lock) /* may race with tgt_cancel_slc_locks() */ if (lock->l_transno != 0) { LASSERT(!list_empty(&lock->l_slc_link)); - LASSERT(ldlm_is_cbpending(lock)); + LASSERT((lock->l_flags & LDLM_FL_CBPENDING)); list_del_init(&lock->l_slc_link); lock->l_transno = 0; ldlm_lock_put(lock); @@ -434,7 +434,7 @@ void tgt_cancel_slc_locks(struct lu_target *lut, __u64 transno) continue; } /* set CBPENDING so that this lock won't be used again */ - ldlm_set_cbpending(lock); + (lock->l_flags |= LDLM_FL_CBPENDING); lock->l_transno = 0; list_move(&lock->l_slc_link, &list); unlock_res_and_lock(lock); -- 1.8.3.1