Whamcloud - gitweb
LU-18136 quota: remove LDLM_LOCK_* macros 11/56011/2
authorTimothy Day <timday@amazon.com>
Tue, 13 Aug 2024 02:22:49 +0000 (22:22 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 23 Aug 2024 22:05:58 +0000 (22:05 +0000)
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 <timday@amazon.com>
Change-Id: I19622b133d95e619d5bd5a12189cc5eb3d2d928f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56011
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Patrick Farrell <patrick.farrell@oracle.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/quota/qmt_handler.c
lustre/quota/qmt_lock.c
lustre/quota/qsd_handler.c
lustre/quota/qsd_lock.c

index cdfb742..079b1d5 100644 (file)
@@ -1262,7 +1262,7 @@ static int qmt_dqacq(const struct lu_env *env, struct lu_device *ld,
        lock = ldlm_handle2lock(&qbody->qb_glb_lockh);
        if (lock == NULL)
                RETURN(-ENOLCK);
-       LDLM_LOCK_PUT(lock);
+       ldlm_lock_put(lock);
 
        uuid = &req->rq_export->exp_client_uuid;
        stype = qmt_uuid2idx(uuid, &idx);
@@ -1293,7 +1293,7 @@ static int qmt_dqacq(const struct lu_env *env, struct lu_device *ld,
 
                if (!obd_uuid_equals(&lock->l_export->exp_client_uuid, uuid)) {
                        /* sorry, no way to cheat ... */
-                       LDLM_LOCK_PUT(lock);
+                       ldlm_lock_put(lock);
                        RETURN(-ENOLCK);
                }
 
@@ -1310,7 +1310,7 @@ static int qmt_dqacq(const struct lu_env *env, struct lu_device *ld,
                        /* lock is being cancelled, prolong timeout */
                        ldlm_refresh_waiting_lock(lock, timeout);
                }
-               LDLM_LOCK_PUT(lock);
+               ldlm_lock_put(lock);
        }
 
        /* extract quota information from global index FID packed in the
index a86dce5..8d708a6 100644 (file)
@@ -106,7 +106,7 @@ int qmt_intent_policy(const struct lu_env *env, struct lu_device *ld,
                lock = ldlm_handle2lock(&reqbody->qb_glb_lockh);
                if (lock == NULL)
                        GOTO(out, rc = -ENOLCK);
-               LDLM_LOCK_PUT(lock);
+               ldlm_lock_put(lock);
 
                stype = qmt_uuid2idx(uuid, &idx);
                if (stype < 0)
@@ -590,7 +590,7 @@ static void qmt_free_lock_array(struct qmt_gl_lock_array *array)
 
        for (i = 0; i < array->q_cnt; i++) {
                LASSERT(array->q_locks[i]);
-               LDLM_LOCK_RELEASE(array->q_locks[i]);
+               ldlm_lock_put(array->q_locks[i]);
                array->q_locks[i] = NULL;
        }
        array->q_cnt = 0;
@@ -631,7 +631,7 @@ again:
 
                count++;
                if (array->q_max != 0 && array->q_cnt < array->q_max) {
-                       array->q_locks[array->q_cnt] = LDLM_LOCK_GET(lock);
+                       array->q_locks[array->q_cnt] = ldlm_lock_get(lock);
                        array->q_cnt++;
                }
        }
@@ -805,7 +805,7 @@ static int qmt_glimpse_lock(const struct lu_env *env, struct qmt_device *qmt,
                CERROR("%s: failed to notify %s of new quota settings\n",
                       qmt->qmt_svname,
                       obd_uuid2str(&work->gl_lock->l_export->exp_client_uuid));
-               LDLM_LOCK_RELEASE(work->gl_lock);
+               ldlm_lock_put(work->gl_lock);
                OBD_FREE_PTR(work);
        }
 out:
index 639ae59..6388ecf 100644 (file)
@@ -137,7 +137,7 @@ static int qsd_ready(struct lquota_entry *lqe, struct lustre_handle *lockh)
 
        /* return remote lock handle to be packed in quota request */
        lustre_handle_copy(lockh, &lock->l_remote_handle);
-       LDLM_LOCK_PUT(lock);
+       ldlm_lock_put(lock);
 
        RETURN(0);
 }
index 093fe0c..ef4067a 100644 (file)
@@ -555,7 +555,7 @@ int qsd_id_lock_match(struct lustre_handle *lockh, struct lustre_handle *rlockh)
        lock = ldlm_handle2lock(lockh);
        LASSERT(lock != NULL);
        lustre_handle_copy(rlockh, &lock->l_remote_handle);
-       LDLM_LOCK_PUT(lock);
+       ldlm_lock_put(lock);
 
        RETURN(0);
 }