From: Timothy Day Date: Tue, 13 Aug 2024 02:18:21 +0000 (-0400) Subject: LU-18136 osc: remove LDLM_LOCK_* macros X-Git-Tag: 2.15.90~31 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9885957671e794956edfdf65e05b4f91f2ce3672;p=fs%2Flustre-release.git LU-18136 osc: remove LDLM_LOCK_* macros These macros are simply duplicates of the corresponding ldlm_lock_* functions. The patch has been generated with the coccinelle script below. @@ expression x; @@ - LDLM_LOCK_PUT(x) + ldlm_lock_put(x) @@ expression x; @@ - LDLM_LOCK_RELEASE(x) + ldlm_lock_put(x) @@ expression x; @@ - LDLM_LOCK_GET(x) + ldlm_lock_get(x) Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Ifeb0d440773a09d12705fdda7177c63ce1c1c893 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56007 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Patrick Farrell Reviewed-by: jsimmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index b884c00..89448f7 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -352,7 +352,7 @@ static void osc_extent_free(struct kref *kref) LASSERT(RB_EMPTY_NODE(&ext->oe_node)); if (ext->oe_dlmlock) { - LDLM_LOCK_RELEASE(ext->oe_dlmlock); + ldlm_lock_put(ext->oe_dlmlock); ext->oe_dlmlock = NULL; } #if 0 @@ -700,7 +700,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, cur->oe_mppr = max_pages; if (olck->ols_dlmlock != NULL) { LASSERT(olck->ols_hold); - cur->oe_dlmlock = LDLM_LOCK_GET(olck->ols_dlmlock); + cur->oe_dlmlock = ldlm_lock_get(olck->ols_dlmlock); } /* grants has been allocated by caller */ @@ -2598,7 +2598,7 @@ int osc_queue_sync_pages(const struct lu_env *env, struct cl_io *io, } oscl = oio->oi_write_osclock ? : oio->oi_read_osclock; if (oscl && oscl->ols_dlmlock != NULL) { - ext->oe_dlmlock = LDLM_LOCK_GET(oscl->ols_dlmlock); + ext->oe_dlmlock = ldlm_lock_get(oscl->ols_dlmlock); } if (ext->oe_dio && !ext->oe_rw) { /* direct io write */ int grants; @@ -3175,7 +3175,7 @@ static bool check_and_discard_cb(const struct lu_env *env, struct cl_io *io, info->oti_fn_index = CL_PAGE_EOF; } - LDLM_LOCK_PUT(tmp); + ldlm_lock_put(tmp); } else { info->oti_ng_index = CL_PAGE_EOF; discard = true; diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index b28ad18..db19163 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -67,7 +67,7 @@ void osc_read_ahead_release(const struct lu_env *env, struct cl_read_ahead *ra) oio->oi_is_readahead = 0; ldlm_lock2handle(dlmlock, &lockh); ldlm_lock_decref(&lockh, LCK_PR); - LDLM_LOCK_PUT(dlmlock); + ldlm_lock_put(dlmlock); } EXPORT_SYMBOL(osc_read_ahead_release); diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index 4dc5fe6..01f0df0 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -53,12 +53,12 @@ */ static struct ldlm_lock *osc_handle_ptr(struct lustre_handle *handle) { - struct ldlm_lock *lock; + struct ldlm_lock *lock; - lock = ldlm_handle2lock(handle); - if (lock != NULL) - LDLM_LOCK_PUT(lock); - return lock; + lock = ldlm_handle2lock(handle); + if (lock) + ldlm_lock_put(lock); + return lock; } /** @@ -336,7 +336,7 @@ static int osc_lock_upcall_speculative(void *cookie, osc_lock_lvb_update(env, osc, dlmlock, NULL); unlock_res_and_lock(dlmlock); - LDLM_LOCK_PUT(dlmlock); + ldlm_lock_put(dlmlock); out: cl_object_put(env, osc2cl(osc)); @@ -571,7 +571,7 @@ int osc_ldlm_glimpse_ast(struct ldlm_lock *dlmlock, void *data) matchdata.lmd_flags = LDLM_FL_TEST_LOCK | LDLM_FL_CBPENDING; matchdata.lmd_match = LDLM_MATCH_UNREF | LDLM_MATCH_AST_ANY; - LDLM_LOCK_GET(dlmlock); + ldlm_lock_get(dlmlock); /* If any dlmlock has l_ast_data set, we must find it or we risk * missing a size update done under a different lock. @@ -583,7 +583,7 @@ int osc_ldlm_glimpse_ast(struct ldlm_lock *dlmlock, void *data) cl_object_get(obj); } unlock_res_and_lock(dlmlock); - LDLM_LOCK_RELEASE(dlmlock); + ldlm_lock_put(dlmlock); dlmlock = NULL; @@ -1082,7 +1082,7 @@ static void osc_lock_detach(const struct lu_env *env, struct osc_lock *olck) /* release a reference taken in osc_lock_upcall(). */ LASSERT(olck->ols_has_ref); - LDLM_LOCK_RELEASE(dlmlock); + ldlm_lock_put(dlmlock); olck->ols_has_ref = 0; EXIT; diff --git a/lustre/osc/osc_object.c b/lustre/osc/osc_object.c index 2b1e90c..6b82cfe 100644 --- a/lustre/osc/osc_object.c +++ b/lustre/osc/osc_object.c @@ -416,7 +416,7 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj, oa->o_handle = lock->l_remote_handle; oa->o_valid |= OBD_MD_FLHANDLE; - LDLM_LOCK_PUT(lock); + ldlm_lock_put(lock); } } diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 180ae77..1da585f 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -3088,7 +3088,7 @@ static int osc_enqueue_interpret(const struct lu_env *env, CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_CANCEL_RACE, 10); ldlm_lock_decref(lockh, mode); - LDLM_LOCK_PUT(lock); + ldlm_lock_put(lock); RETURN(rc); } @@ -3169,7 +3169,7 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id, unlock_res_and_lock(matched); ldlm_lock_decref(&lockh, mode); - LDLM_LOCK_PUT(matched); + ldlm_lock_put(matched); RETURN(rc); } else if (osc_set_lock_data(matched, einfo->ei_cbdata)) { *flags |= LDLM_FL_LVB_READY; @@ -3178,11 +3178,11 @@ int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id, (*upcall)(cookie, &lockh, ELDLM_LOCK_MATCHED); ldlm_lock_decref(&lockh, mode); - LDLM_LOCK_PUT(matched); + ldlm_lock_put(matched); RETURN(ELDLM_OK); } else { ldlm_lock_decref(&lockh, mode); - LDLM_LOCK_PUT(matched); + ldlm_lock_put(matched); } } @@ -3270,7 +3270,7 @@ int osc_match_base(const struct lu_env *env, struct obd_export *exp, ldlm_lock_decref(lockh, rc); rc = 0; } - LDLM_LOCK_PUT(lock); + ldlm_lock_put(lock); } RETURN(rc); }