Whamcloud - gitweb
LU-8238 ldlm: rid of obsolete param of ldlm_resource_get() 31/20631/10
authorBobi Jam <bobijam@whamcloud.com>
Thu, 2 Sep 2021 15:44:57 +0000 (23:44 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 8 Aug 2022 19:53:00 +0000 (19:53 +0000)
The second parameter @parent of ldlm_resource_get() is obsolete, just
remove it.

Test-Parameters: trivial
Change-Id: I88af99c6984eda50a21da4d516ce7dea8cba60f5
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/20631
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
16 files changed:
lustre/include/lustre_dlm.h
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_request.c
lustre/ldlm/ldlm_resource.c
lustre/mdc/mdc_dev.c
lustre/mdc/mdc_locks.c
lustre/mdc/mdc_reint.c
lustre/mdt/mdt_io.c
lustre/mgs/mgs_barrier.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_io.c
lustre/ofd/ofd_obd.c
lustre/osc/osc_object.c
lustre/osc/osc_request.c
lustre/quota/qmt_lock.c

index dc738f4..8fc8127 100644 (file)
@@ -1668,7 +1668,6 @@ static inline void ldlm_svc_get_eopc(const struct ldlm_request *dlm_req,
 
 /* resource.c - internal */
 struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns,
-                                       struct ldlm_resource *parent,
                                        const struct ldlm_res_id *,
                                        enum ldlm_type type, int create);
 struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res);
index 7d8e5e2..ff40ece 100644 (file)
@@ -698,7 +698,7 @@ void ldlm_resource_prolong(struct ldlm_prolong_args *arg)
 
        ENTRY;
 
-       res = ldlm_resource_get(arg->lpa_export->exp_obd->obd_namespace, NULL,
+       res = ldlm_resource_get(arg->lpa_export->exp_obd->obd_namespace,
                                &arg->lpa_resid, LDLM_EXTENT, 0);
        if (IS_ERR(res)) {
                CDEBUG(D_DLMTRACE, "Failed to get resource for resid %llu/%llu\n",
index 3ceadc9..2830412 100644 (file)
@@ -536,7 +536,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
         type = oldres->lr_type;
         unlock_res_and_lock(lock);
 
-       newres = ldlm_resource_get(ns, NULL, new_resid, type, 1);
+       newres = ldlm_resource_get(ns, new_resid, type, 1);
        if (IS_ERR(newres))
                RETURN(PTR_ERR(newres));
 
@@ -1438,7 +1438,7 @@ enum ldlm_mode ldlm_lock_match_with_skip(struct ldlm_namespace *ns,
                *data.lmd_mode = data.lmd_old->l_req_mode;
        }
 
-       res = ldlm_resource_get(ns, NULL, res_id, type, 0);
+       res = ldlm_resource_get(ns, res_id, type, 0);
        if (IS_ERR(res)) {
                LASSERT(data.lmd_old == NULL);
                RETURN(0);
@@ -1667,7 +1667,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
        int                     rc;
        ENTRY;
 
-       res = ldlm_resource_get(ns, NULL, res_id, type, 1);
+       res = ldlm_resource_get(ns, res_id, type, 1);
        if (IS_ERR(res))
                RETURN(ERR_CAST(res));
 
index 048f5c3..02deec2 100644 (file)
@@ -2187,7 +2187,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
 
        ENTRY;
 
-       res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+       res = ldlm_resource_get(ns, res_id, 0, 0);
        if (IS_ERR(res)) {
                /* This is not a problem. */
                CDEBUG(D_INFO, "No resource %llu\n", res_id->name[0]);
@@ -2342,7 +2342,7 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns,
 
        LASSERTF(ns != NULL, "must pass in namespace\n");
 
-       res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+       res = ldlm_resource_get(ns, res_id, 0, 0);
        if (IS_ERR(res))
                RETURN(0);
 
index 3360fa5..b00579e 100644 (file)
@@ -1481,9 +1481,8 @@ static void ldlm_resource_free(struct ldlm_resource *res)
  * Returns: referenced, unlocked ldlm_resource or ERR_PTR
  */
 struct ldlm_resource *
-ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
-                 const struct ldlm_res_id *name, enum ldlm_type type,
-                 int create)
+ldlm_resource_get(struct ldlm_namespace *ns, const struct ldlm_res_id *name,
+                 enum ldlm_type type, int create)
 {
        struct hlist_node       *hnode;
        struct ldlm_resource    *res = NULL;
@@ -1493,7 +1492,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
        int hash;
 
        LASSERT(ns != NULL);
-       LASSERT(parent == NULL);
        LASSERT(ns->ns_rs_hash != NULL);
        LASSERT(name->name[0] != 0);
 
index 2705461..563187e 100644 (file)
@@ -1025,8 +1025,9 @@ static int mdc_get_lock_handle(const struct lu_env *env, struct osc_object *osc,
 
                resname = &osc_env_info(env)->oti_resname;
                fid_build_reg_res_name(lu_object_fid(osc2lu(osc)), resname);
-               res = ldlm_resource_get(osc_export(osc)->exp_obd->obd_namespace,
-                                       NULL, resname, LDLM_IBITS, 0);
+               res = ldlm_resource_get(osc_export(osc)->
+                                                       exp_obd->obd_namespace,
+                                       resname, LDLM_IBITS, 0);
                if (IS_ERR(res))
                        CERROR("No lock resource for "DFID"\n",
                                PFID(lu_object_fid(osc2lu(osc))));
index 41692b3..8612405 100644 (file)
@@ -176,7 +176,7 @@ int mdc_null_inode(struct obd_export *exp,
 
        fid_build_reg_res_name(fid, &res_id);
 
-       res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
+       res = ldlm_resource_get(ns, &res_id, 0, 0);
        if (IS_ERR(res))
                RETURN(0);
 
index f75d559..4d76294 100644 (file)
@@ -80,7 +80,7 @@ int mdc_resource_get_unused_res(struct obd_export *exp,
        if (exp_connect_cancelset(exp) && !ns_connect_cancelset(ns))
                RETURN(0);
 
-       res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+       res = ldlm_resource_get(ns, res_id, 0, 0);
        if (IS_ERR(res))
                RETURN(0);
        LDLM_RESOURCE_ADDREF(res);
index 38b7ad1..8858135 100644 (file)
@@ -65,7 +65,7 @@ static void mdt_dom_resource_prolong(struct ldlm_prolong_args *arg)
 
        ENTRY;
 
-       res = ldlm_resource_get(arg->lpa_export->exp_obd->obd_namespace, NULL,
+       res = ldlm_resource_get(arg->lpa_export->exp_obd->obd_namespace,
                                &arg->lpa_resid, LDLM_IBITS, 0);
        if (IS_ERR(res)) {
                CDEBUG(D_DLMTRACE,
@@ -713,8 +713,7 @@ void mdt_dom_obj_lvb_update(const struct lu_env *env, struct mdt_object *mo,
        struct ldlm_resource *res;
 
        fid_build_reg_res_name(mdt_object_fid(mo), &resid);
-       res = ldlm_resource_get(mdt->mdt_namespace, NULL, &resid,
-                               LDLM_IBITS, 1);
+       res = ldlm_resource_get(mdt->mdt_namespace, &resid, LDLM_IBITS, 1);
        if (IS_ERR(res))
                return;
 
@@ -1341,8 +1340,7 @@ int mdt_dom_object_size(const struct lu_env *env, struct mdt_device *mdt,
        ENTRY;
 
        fid_build_reg_res_name(fid, &resid);
-       res = ldlm_resource_get(mdt->mdt_namespace, NULL, &resid,
-                               LDLM_IBITS, 1);
+       res = ldlm_resource_get(mdt->mdt_namespace, &resid, LDLM_IBITS, 1);
        if (IS_ERR(res))
                RETURN(-ENOENT);
 
index c419421..bf8a725 100644 (file)
@@ -133,7 +133,7 @@ static int mgs_barrier_glimpse_lock(const struct lu_env *env,
        if (rc)
                RETURN(rc);
 
-       res = ldlm_resource_get(mgs->mgs_obd->obd_namespace, NULL, &res_id,
+       res = ldlm_resource_get(mgs->mgs_obd->obd_namespace, &res_id,
                                LDLM_PLAIN, 0);
        if (IS_ERR(res))
                RETURN(PTR_ERR(res));
index 48ac842..6b9ea6e 100644 (file)
@@ -1379,8 +1379,8 @@ out:
                 * otherwise concurrent destroy can make the object unavailable
                 * for 2nd lu_object_find() waiting for the first reference
                 * to go... deadlock! */
-               res = ldlm_resource_get(ofd->ofd_namespace, NULL,
-                                       &tsi->tsi_resid, LDLM_EXTENT, 0);
+               res = ldlm_resource_get(ofd->ofd_namespace, &tsi->tsi_resid,
+                                       LDLM_EXTENT, 0);
                if (!IS_ERR(res)) {
                        ldlm_res_lvbo_update(res, NULL, 0);
                        ldlm_resource_putref(res);
@@ -2071,8 +2071,7 @@ out:
        if (srvlock)
                tgt_data_unlock(&lh, LCK_PW);
        if (rc == 0) {
-               res = ldlm_resource_get(ns, NULL, &tsi->tsi_resid,
-                                       LDLM_EXTENT, 0);
+               res = ldlm_resource_get(ns, &tsi->tsi_resid, LDLM_EXTENT, 0);
                if (!IS_ERR(res)) {
                        struct ost_lvb *res_lvb;
 
@@ -2188,8 +2187,7 @@ out:
                 * otherwise concurrent destroy can make the object unavailable
                 * for 2nd lu_object_find() waiting for the first reference
                 * to go... deadlock! */
-               res = ldlm_resource_get(ns, NULL, &tsi->tsi_resid,
-                                       LDLM_EXTENT, 0);
+               res = ldlm_resource_get(ns, &tsi->tsi_resid, LDLM_EXTENT, 0);
                if (!IS_ERR(res)) {
                        struct ost_lvb *res_lvb;
 
index 71fe365..a620aa1 100644 (file)
@@ -1529,7 +1529,7 @@ int ofd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
                 */
                if (rc == 0 && (rnb[0].rnb_flags & OBD_BRW_SRVLOCK)) {
                        ost_fid_build_resid(fid, &info->fti_resid);
-                       rs = ldlm_resource_get(ns, NULL, &info->fti_resid,
+                       rs = ldlm_resource_get(ns, &info->fti_resid,
                                               LDLM_EXTENT, 0);
                        if (!IS_ERR(rs)) {
                                ldlm_res_lvbo_update(rs, NULL, 1);
index 67ebade..1414050 100644 (file)
@@ -885,8 +885,7 @@ out:
                 * for 2nd lu_object_find() waiting for the first reference
                 * to go... deadlock!
                 */
-               res = ldlm_resource_get(ns, NULL, &info->fti_resid,
-                                       LDLM_EXTENT, 0);
+               res = ldlm_resource_get(ns, &info->fti_resid, LDLM_EXTENT, 0);
                if (!IS_ERR(res)) {
                        ldlm_res_lvbo_update(res, NULL, 0);
                        ldlm_resource_putref(res);
index 64f6b94..ea1d290 100644 (file)
@@ -398,9 +398,9 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
 
                        resname = &osc_env_info(env)->oti_resname;
                        ostid_build_res_name(&oinfo->loi_oi, resname);
-                       res = ldlm_resource_get(
-                               osc_export(cl2osc(obj))->exp_obd->obd_namespace,
-                               NULL, resname, LDLM_EXTENT, 0);
+                       res = ldlm_resource_get(osc_export(cl2osc(obj))->
+                                                       exp_obd->obd_namespace,
+                                               resname, LDLM_EXTENT, 0);
                        if (IS_ERR(res))
                                CERROR("No lock resource\n");
                        else
index abf2fcc..5847bf2 100644 (file)
@@ -582,7 +582,7 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
                RETURN(0);
 
        ostid_build_res_name(&oa->o_oi, &res_id);
-       res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
+       res = ldlm_resource_get(ns, &res_id, 0, 0);
        if (IS_ERR(res))
                RETURN(0);
 
index 49421e3..5ee05c2 100644 (file)
@@ -810,7 +810,7 @@ void qmt_glb_lock_notify(const struct lu_env *env, struct lquota_entry *lqe,
 
        /* look up ldlm resource associated with global index */
        fid_build_reg_res_name(&qti->qti_fid, &qti->qti_resid);
-       res = ldlm_resource_get(pool->qpi_qmt->qmt_ns, NULL, &qti->qti_resid,
+       res = ldlm_resource_get(pool->qpi_qmt->qmt_ns, &qti->qti_resid,
                                LDLM_PLAIN, 0);
        if (IS_ERR(res)) {
                /* this might happen if no slaves have enqueued global quota
@@ -869,8 +869,7 @@ static void qmt_id_lock_glimpse(const struct lu_env *env,
 
        lquota_generate_fid(&qti->qti_fid, pool->qpi_rtype, lqe_qtype(lqe));
        fid_build_quota_res_name(&qti->qti_fid, &lqe->lqe_id, &qti->qti_resid);
-       res = ldlm_resource_get(qmt->qmt_ns, NULL, &qti->qti_resid, LDLM_PLAIN,
-                               0);
+       res = ldlm_resource_get(qmt->qmt_ns, &qti->qti_resid, LDLM_PLAIN, 0);
        if (IS_ERR(res)) {
                /* this might legitimately happens if slaves haven't had the
                 * opportunity to enqueue quota lock yet. */