Whamcloud - gitweb
LU-2193 ldlm: print FID in lvbo_init(), lvbo_update
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 9 Nov 2012 09:47:47 +0000 (02:47 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 6 Jun 2013 01:52:09 +0000 (21:52 -0400)
Print the namespace and OBD device name, as well as the first two
lock resource fields (typically the FID) if there is an error with
loading the object from disk.  This will be more important with
FID-on-OST and also the MDS.  Using fid_extract_from_res_name() isn't
possible in the LDLM code, since the lock resource may not be a FID.

Make fid_extract_quota_resid() argument order and name consistent
with other fid_*_res() functions, with FID first and resource second.

Fix a bug in ofd_lvbo_init() where NULL lvb is accessed on error.

Print FID in ofd_lvbo_update() CDEBUG() and CERROR() messages.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I7f323f15a5bf4a12865a64b2cd2bb0ebe68c6e78
Reviewed-on: http://review.whamcloud.com/4501
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_fid.h
lustre/ldlm/ldlm_resource.c
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_lvb.c
lustre/mdt/mdt_reint.c
lustre/ofd/ofd_lvb.c
lustre/quota/qmt_lock.c
lustre/quota/qsd_request.c

index 6210ff8..81e67f9 100644 (file)
@@ -911,7 +911,7 @@ static inline int lu_fid_cmp(const struct lu_fid *f0,
                 __diff_normalize(fid_ver(f0), fid_ver(f1));
 }
 
-static inline void ostid_cpu_to_le(struct ost_id *src_oi,
+static inline void ostid_cpu_to_le(const struct ost_id *src_oi,
                                   struct ost_id *dst_oi)
 {
        if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
@@ -922,7 +922,7 @@ static inline void ostid_cpu_to_le(struct ost_id *src_oi,
        }
 }
 
-static inline void ostid_le_to_cpu(struct ost_id *src_oi,
+static inline void ostid_le_to_cpu(const struct ost_id *src_oi,
                                   struct ost_id *dst_oi)
 {
        if (fid_seq_is_mdt0(ostid_seq(src_oi))) {
index 3c74340..a048bdb 100644 (file)
@@ -488,74 +488,75 @@ struct ldlm_namespace;
  * renaming name[2,3] fields that need to be used for the quota identifier.
  */
 static inline struct ldlm_res_id *
-fid_build_reg_res_name(const struct lu_fid *f,
-                       struct ldlm_res_id *name)
+fid_build_reg_res_name(const struct lu_fid *fid, struct ldlm_res_id *res)
 {
-        memset(name, 0, sizeof *name);
-        name->name[LUSTRE_RES_ID_SEQ_OFF] = fid_seq(f);
-        name->name[LUSTRE_RES_ID_VER_OID_OFF] = fid_ver_oid(f);
-        return name;
+       memset(res, 0, sizeof(*res));
+       res->name[LUSTRE_RES_ID_SEQ_OFF] = fid_seq(fid);
+       res->name[LUSTRE_RES_ID_VER_OID_OFF] = fid_ver_oid(fid);
+
+       return res;
+}
+
+/*
+ * Return true if resource is for object identified by FID.
+ */
+static inline int fid_res_name_eq(const struct lu_fid *fid,
+                                 const struct ldlm_res_id *res)
+{
+       return res->name[LUSTRE_RES_ID_SEQ_OFF] == fid_seq(fid) &&
+              res->name[LUSTRE_RES_ID_VER_OID_OFF] == fid_ver_oid(fid);
+}
+
+/*
+ * Extract FID from LDLM resource. Reverse of fid_build_reg_res_name().
+ */
+static inline struct lu_fid *
+fid_extract_from_res_name(struct lu_fid *fid, const struct ldlm_res_id *res)
+{
+       fid->f_seq = res->name[LUSTRE_RES_ID_SEQ_OFF];
+       fid->f_oid = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF]);
+       fid->f_ver = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
+       LASSERT(fid_res_name_eq(fid, res));
+
+       return fid;
 }
 
 /*
  * Build (DLM) resource identifier from global quota FID and quota ID.
  */
 static inline struct ldlm_res_id *
-fid_build_quota_resid(const struct lu_fid *glb_fid, union lquota_id *qid,
+fid_build_quota_res_name(const struct lu_fid *glb_fid, union lquota_id *qid,
                      struct ldlm_res_id *res)
 {
        fid_build_reg_res_name(glb_fid, res);
        res->name[LUSTRE_RES_ID_QUOTA_SEQ_OFF] = fid_seq(&qid->qid_fid);
        res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] = fid_ver_oid(&qid->qid_fid);
+
        return res;
 }
 
 /*
  * Extract global FID and quota ID from resource name
  */
-static inline void fid_extract_quota_resid(struct ldlm_res_id *res,
-                                          struct lu_fid *glb_fid,
-                                          union lquota_id *qid)
+static inline void fid_extract_from_quota_res(struct lu_fid *glb_fid,
+                                             union lquota_id *qid,
+                                             const struct ldlm_res_id *res)
 {
-       glb_fid->f_seq = res->name[LUSTRE_RES_ID_SEQ_OFF];
-       glb_fid->f_oid = (__u32)res->name[LUSTRE_RES_ID_VER_OID_OFF];
-       glb_fid->f_ver = (__u32)(res->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32);
-
+       fid_extract_from_res_name(glb_fid, res);
        qid->qid_fid.f_seq = res->name[LUSTRE_RES_ID_QUOTA_SEQ_OFF];
        qid->qid_fid.f_oid = (__u32)res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF];
        qid->qid_fid.f_ver =
                (__u32)(res->name[LUSTRE_RES_ID_QUOTA_VER_OID_OFF] >> 32);
 }
 
-/*
- * Return true if resource is for object identified by fid.
- */
-static inline int fid_res_name_eq(const struct lu_fid *f,
-                                  const struct ldlm_res_id *name)
-{
-        return name->name[LUSTRE_RES_ID_SEQ_OFF] == fid_seq(f) &&
-               name->name[LUSTRE_RES_ID_VER_OID_OFF] == fid_ver_oid(f);
-}
-
-/* reverse function of fid_build_reg_res_name() */
-static inline void fid_build_from_res_name(struct lu_fid *f,
-                                          const struct ldlm_res_id *name)
-{
-       fid_zero(f);
-       f->f_seq = name->name[LUSTRE_RES_ID_SEQ_OFF];
-       f->f_oid = name->name[LUSTRE_RES_ID_VER_OID_OFF] & 0xffffffff;
-       f->f_ver = name->name[LUSTRE_RES_ID_VER_OID_OFF] >> 32;
-       LASSERT(fid_res_name_eq(f, name));
-}
-
 static inline struct ldlm_res_id *
-fid_build_pdo_res_name(const struct lu_fid *f,
-                       unsigned int hash,
-                       struct ldlm_res_id *name)
+fid_build_pdo_res_name(const struct lu_fid *fid, unsigned int hash,
+                      struct ldlm_res_id *res)
 {
-        fid_build_reg_res_name(f, name);
-        name->name[LUSTRE_RES_ID_HSH_OFF] = hash;
-        return name;
+       fid_build_reg_res_name(fid, res);
+       res->name[LUSTRE_RES_ID_HSH_OFF] = hash;
+
+       return res;
 }
 
 /**
@@ -584,7 +585,7 @@ static inline void ostid_build_res_name(struct ost_id *oi,
                name->name[LUSTRE_RES_ID_SEQ_OFF] = ostid_id(oi);
                name->name[LUSTRE_RES_ID_VER_OID_OFF] = ostid_seq(oi);
        } else {
-               fid_build_reg_res_name((struct lu_fid *)oi, name);
+               fid_build_reg_res_name(&oi->oi_fid, name);
        }
 }
 
@@ -597,7 +598,7 @@ static inline void ostid_res_name_to_id(struct ost_id *oi,
                ostid_set_id(oi, name->name[LUSTRE_RES_ID_SEQ_OFF]);
        } else {
                /* new resid */
-               fid_build_from_res_name((struct lu_fid *)oi, name);
+               fid_extract_from_res_name(&oi->oi_fid, name);
        }
 }
 
@@ -644,7 +645,7 @@ static inline void ost_fid_from_resid(struct lu_fid *fid,
                ostid_to_fid(fid, &oi, 0);
        } else {
                /* new resid */
-               fid_build_from_res_name(fid, name);
+               fid_extract_from_res_name(fid, name);
        }
 }
 
index 8b73607..43fb2d1 100644 (file)
@@ -1167,8 +1167,9 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
                 OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_CREATE_RESOURCE, 2);
                 rc = ns->ns_lvbo->lvbo_init(res);
                if (rc < 0) {
-                       CERROR("lvbo_init failed for resource "
-                              LPU64": rc %d\n", name->name[0], rc);
+                       CERROR("%s: lvbo_init failed for resource "LPX64":"
+                              LPX64": rc = %d\n", ns->ns_obd->obd_name,
+                              name->name[0], name->name[1], rc);
                        if (res->lr_lvb_data) {
                                OBD_FREE(res->lr_lvb_data, res->lr_lvb_len);
                                res->lr_lvb_data = NULL;
index d39c531..6283f66 100644 (file)
@@ -548,7 +548,7 @@ void mdt_dump_lmm(int level, const struct lov_mds_md *lmm)
        LASSERT(count <= LOV_MAX_STRIPE_COUNT);
        for (i = 0, lod = lmm->lmm_objects; i < count; i++, lod++) {
                struct ost_id   oi;
-               ostid_le_to_cpu((struct ost_id *)&lod->l_ost_oi, &oi);
+               ostid_le_to_cpu(&lod->l_ost_oi, &oi);
                CDEBUG(level, "stripe %u idx %u subobj "DOSTID"\n",
                       i, le32_to_cpu(lod->l_ost_idx), POSTID(&oi));
        }
index 92b8f30..9698245 100644 (file)
@@ -133,7 +133,7 @@ static int mdt_lvbo_fill(struct ldlm_lock *lock, void *lvb, int lvblen)
 
        /* XXX get fid by resource id. why don't include fid in ldlm_resource */
        fid = &info->mti_tmp_fid2;
-       fid_build_from_res_name(fid, &lock->l_resource->lr_name);
+       fid_extract_from_res_name(fid, &lock->l_resource->lr_name);
 
        obj = mdt_object_find(&env, info->mti_mdt, fid);
        if (IS_ERR(obj))
index d03c231..b2d97f5 100644 (file)
@@ -986,31 +986,31 @@ out_unlock_parent:
  * (lh->mlh_pdo_hash) in parallel directory lock.
  */
 static int mdt_pdir_hash_lock(struct mdt_thread_info *info,
-                       struct mdt_lock_handle *lh,
-                       struct mdt_object *obj, __u64 ibits)
+                             struct mdt_lock_handle *lh,
+                             struct mdt_object *obj, __u64 ibits)
 {
-        struct ldlm_res_id *res_id = &info->mti_res_id;
-        struct ldlm_namespace *ns = info->mti_mdt->mdt_namespace;
-        ldlm_policy_data_t *policy = &info->mti_policy;
-        int rc;
+       struct ldlm_res_id *res = &info->mti_res_id;
+       struct ldlm_namespace *ns = info->mti_mdt->mdt_namespace;
+       ldlm_policy_data_t *policy = &info->mti_policy;
+       int rc;
 
-        /*
-         * Finish res_id initializing by name hash marking part of
-         * directory which is taking modification.
-         */
-        LASSERT(lh->mlh_pdo_hash != 0);
-        fid_build_pdo_res_name(mdt_object_fid(obj), lh->mlh_pdo_hash, res_id);
-        memset(policy, 0, sizeof(*policy));
-        policy->l_inodebits.bits = ibits;
-        /*
-         * Use LDLM_FL_LOCAL_ONLY for this lock. We do not know yet if it is
-         * going to be sent to client. If it is - mdt_intent_policy() path will
-         * fix it up and turn FL_LOCAL flag off.
-         */
-        rc = mdt_fid_lock(ns, &lh->mlh_reg_lh, lh->mlh_reg_mode, policy,
-                          res_id, LDLM_FL_LOCAL_ONLY | LDLM_FL_ATOMIC_CB,
-                          &info->mti_exp->exp_handle.h_cookie);
-        return rc;
+       /*
+        * Finish res_id initializing by name hash marking part of
+        * directory which is taking modification.
+        */
+       LASSERT(lh->mlh_pdo_hash != 0);
+       fid_build_pdo_res_name(mdt_object_fid(obj), lh->mlh_pdo_hash, res);
+       memset(policy, 0, sizeof(*policy));
+       policy->l_inodebits.bits = ibits;
+       /*
+        * Use LDLM_FL_LOCAL_ONLY for this lock. We do not know yet if it is
+        * going to be sent to client. If it is - mdt_intent_policy() path will
+        * fix it up and turn FL_LOCAL flag off.
+        */
+       rc = mdt_fid_lock(ns, &lh->mlh_reg_lh, lh->mlh_reg_mode, policy,
+                         res, LDLM_FL_LOCAL_ONLY | LDLM_FL_ATOMIC_CB,
+                         &info->mti_exp->exp_handle.h_cookie);
+       return rc;
 }
 
 static int mdt_rename_lock(struct mdt_thread_info *info,
index 517c53c..7f41854 100644 (file)
@@ -54,7 +54,7 @@ static int ofd_lvbo_free(struct ldlm_resource *res)
 /* Called with res->lr_lvb_sem held */
 static int ofd_lvbo_init(struct ldlm_resource *res)
 {
-       struct ost_lvb          *lvb = NULL;
+       struct ost_lvb          *lvb;
        struct ofd_device       *ofd;
        struct ofd_object       *fo;
        struct ofd_thread_info  *info;
@@ -81,7 +81,7 @@ static int ofd_lvbo_init(struct ldlm_resource *res)
 
        OBD_ALLOC_PTR(lvb);
        if (lvb == NULL)
-               GOTO(out, rc = -ENOMEM);
+               GOTO(out_env, rc = -ENOMEM);
 
        res->lr_lvb_data = lvb;
        res->lr_lvb_len = sizeof(*lvb);
@@ -90,11 +90,11 @@ static int ofd_lvbo_init(struct ldlm_resource *res)
        ost_fid_from_resid(&info->fti_fid, &res->lr_name);
        fo = ofd_object_find(&env, ofd, &info->fti_fid);
        if (IS_ERR(fo))
-               GOTO(out, rc = PTR_ERR(fo));
+               GOTO(out_lvb, rc = PTR_ERR(fo));
 
        rc = ofd_attr_get(&env, fo, &info->fti_attr);
        if (rc)
-               GOTO(out_put, rc);
+               GOTO(out_obj, rc);
 
        lvb->lvb_size = info->fti_attr.la_size;
        lvb->lvb_blocks = info->fti_attr.la_blocks;
@@ -102,18 +102,19 @@ static int ofd_lvbo_init(struct ldlm_resource *res)
        lvb->lvb_atime = info->fti_attr.la_atime;
        lvb->lvb_ctime = info->fti_attr.la_ctime;
 
-       CDEBUG(D_DLMTRACE, "res: "LPX64" initial lvb size: "LPX64", "
+       CDEBUG(D_DLMTRACE, "res: "DFID" initial lvb size: "LPU64", "
               "mtime: "LPX64", blocks: "LPX64"\n",
-              res->lr_name.name[0], lvb->lvb_size,
+              PFID(&info->fti_fid), lvb->lvb_size,
               lvb->lvb_mtime, lvb->lvb_blocks);
 
        EXIT;
-out_put:
+out_obj:
        ofd_object_put(&env, fo);
-out:
-       lu_env_fini(&env);
-       if (rc && lvb != NULL)
+out_lvb:
+       if (rc != 0)
                OST_LVB_SET_ERR(lvb->lvb_blocks, rc);
+out_env:
+       lu_env_fini(&env);
        /* Don't free lvb data on lookup error */
        return rc;
 }
@@ -142,18 +143,20 @@ static int ofd_lvbo_update(struct ldlm_resource *res,
        ofd = ldlm_res_to_ns(res)->ns_lvbp;
        LASSERT(ofd != NULL);
 
-       lvb = res->lr_lvb_data;
-       if (lvb == NULL) {
-               CERROR("%s: no lvb when running lvbo_update, res: "LPU64"!\n",
-                      ofd_obd(ofd)->obd_name, res->lr_name.name[0]);
-               RETURN(0);
-       }
-
        rc = lu_env_init(&env, LCT_DT_THREAD);
        if (rc)
-               GOTO(out_unlock, rc);
+               RETURN(rc);
 
        info = ofd_info_init(&env, NULL);
+       fid_extract_from_res_name(&info->fti_fid, &res->lr_name);
+
+       lvb = res->lr_lvb_data;
+       if (lvb == NULL) {
+               CERROR("%s: no LVB data for "DFID"\n",
+                      ofd_obd(ofd)->obd_name, PFID(&info->fti_fid));
+               GOTO(out_env, rc = 0);
+       }
+
        /* Update the LVB from the network message */
        if (req != NULL) {
                struct ost_lvb *rpc_lvb;
@@ -187,32 +190,32 @@ static int ofd_lvbo_update(struct ldlm_resource *res,
 
                lock_res(res);
                if (rpc_lvb->lvb_size > lvb->lvb_size || !increase_only) {
-                       CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb size: "
-                              LPU64" -> "LPU64"\n", res->lr_name.name[0],
+                       CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb size: "
+                              LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                               lvb->lvb_size, rpc_lvb->lvb_size);
                        lvb->lvb_size = rpc_lvb->lvb_size;
                }
                if (rpc_lvb->lvb_mtime > lvb->lvb_mtime || !increase_only) {
-                       CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb mtime: "
-                              LPU64" -> "LPU64"\n", res->lr_name.name[0],
+                       CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb mtime: "
+                              LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                               lvb->lvb_mtime, rpc_lvb->lvb_mtime);
                        lvb->lvb_mtime = rpc_lvb->lvb_mtime;
                }
                if (rpc_lvb->lvb_atime > lvb->lvb_atime || !increase_only) {
-                       CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb atime: "
-                              LPU64" -> "LPU64"\n", res->lr_name.name[0],
+                       CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb atime: "
+                              LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                               lvb->lvb_atime, rpc_lvb->lvb_atime);
                        lvb->lvb_atime = rpc_lvb->lvb_atime;
                }
                if (rpc_lvb->lvb_ctime > lvb->lvb_ctime || !increase_only) {
-                       CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb ctime: "
-                              LPU64" -> "LPU64"\n", res->lr_name.name[0],
+                       CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb ctime: "
+                              LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                               lvb->lvb_ctime, rpc_lvb->lvb_ctime);
                        lvb->lvb_ctime = rpc_lvb->lvb_ctime;
                }
                if (rpc_lvb->lvb_blocks > lvb->lvb_blocks || !increase_only) {
-                       CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb blocks: "
-                              LPU64" -> "LPU64"\n", res->lr_name.name[0],
+                       CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb blocks: "
+                              LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                               lvb->lvb_blocks, rpc_lvb->lvb_blocks);
                        lvb->lvb_blocks = rpc_lvb->lvb_blocks;
                }
@@ -232,34 +235,33 @@ disk_update:
 
        lock_res(res);
        if (info->fti_attr.la_size > lvb->lvb_size || !increase_only) {
-               CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb size from disk: "
-                      LPU64" -> %llu\n", res->lr_name.name[0],
+               CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb size from disk: "
+                      LPU64" -> %llu\n", PFID(&info->fti_fid),
                       lvb->lvb_size, info->fti_attr.la_size);
                lvb->lvb_size = info->fti_attr.la_size;
        }
 
        if (info->fti_attr.la_mtime >lvb->lvb_mtime || !increase_only) {
-               CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb mtime from disk: "
-                      LPU64" -> "LPU64"\n", res->lr_name.name[0],
+               CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb mtime from disk: "
+                      LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                       lvb->lvb_mtime, info->fti_attr.la_mtime);
                lvb->lvb_mtime = info->fti_attr.la_mtime;
        }
        if (info->fti_attr.la_atime >lvb->lvb_atime || !increase_only) {
-               CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb atime from disk: "
-                      LPU64" -> "LPU64"\n", res->lr_name.name[0],
+               CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb atime from disk: "
+                      LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                       lvb->lvb_atime, info->fti_attr.la_atime);
                lvb->lvb_atime = info->fti_attr.la_atime;
        }
        if (info->fti_attr.la_ctime >lvb->lvb_ctime || !increase_only) {
-               CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb ctime from disk: "
-                      LPU64" -> "LPU64"\n", res->lr_name.name[0],
+               CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb ctime from disk: "
+                      LPU64" -> "LPU64"\n", PFID(&info->fti_fid),
                       lvb->lvb_ctime, info->fti_attr.la_ctime);
                lvb->lvb_ctime = info->fti_attr.la_ctime;
        }
        if (info->fti_attr.la_blocks > lvb->lvb_blocks || !increase_only) {
-               CDEBUG(D_DLMTRACE,"res: "LPU64" updating lvb blocks from disk: "
-                      LPU64" -> %llu\n", res->lr_name.name[0],
-                      lvb->lvb_blocks,
+               CDEBUG(D_DLMTRACE, "res: "DFID" updating lvb blocks from disk: "
+                      LPU64" -> %llu\n", PFID(&info->fti_fid), lvb->lvb_blocks,
                       (unsigned long long)info->fti_attr.la_blocks);
                lvb->lvb_blocks = info->fti_attr.la_blocks;
        }
@@ -269,7 +271,6 @@ out_obj:
        ofd_object_put(&env, fo);
 out_env:
        lu_env_fini(&env);
-out_unlock:
        return rc;
 }
 
@@ -304,9 +305,9 @@ static int ofd_lvbo_fill(struct ldlm_lock *lock, void *buf, int buflen)
 }
 
 struct ldlm_valblock_ops ofd_lvbo = {
-       lvbo_init:      ofd_lvbo_init,
-       lvbo_update:    ofd_lvbo_update,
-       lvbo_free:      ofd_lvbo_free,
-       lvbo_size:      ofd_lvbo_size,
-       lvbo_fill:      ofd_lvbo_fill
+       .lvbo_init      = ofd_lvbo_init,
+       .lvbo_update    = ofd_lvbo_update,
+       .lvbo_free      = ofd_lvbo_free,
+       .lvbo_size      = ofd_lvbo_size,
+       .lvbo_fill      = ofd_lvbo_fill
 };
index 9339580..e73fcd1 100644 (file)
@@ -174,14 +174,12 @@ int qmt_lvbo_init(struct lu_device *ld, struct ldlm_resource *res)
 
        /* initialize environment */
        rc = lu_env_init(env, LCT_MD_THREAD);
-       if (rc) {
-               OBD_FREE_PTR(env);
-               RETURN(rc);
-       }
+       if (rc != 0)
+               GOTO(out_free, rc);
        qti = qmt_info(env);
 
        /* extract global index FID and quota identifier */
-       fid_extract_quota_resid(&res->lr_name, &qti->qti_fid, &qti->qti_id);
+       fid_extract_from_quota_res(&qti->qti_fid, &qti->qti_id, &res->lr_name);
 
        /* sanity check the global index FID */
        rc = lquota_extract_fid(&qti->qti_fid, &pool_id, &pool_type, &qtype);
@@ -222,10 +220,11 @@ int qmt_lvbo_init(struct lu_device *ld, struct ldlm_resource *res)
                CDEBUG(D_QUOTA, DFID" initialized lvb\n", PFID(&qti->qti_fid));
        }
 
-       res->lr_lvb_len  = sizeof(struct lquota_lvb);
+       res->lr_lvb_len = sizeof(struct lquota_lvb);
        EXIT;
 out:
        lu_env_fini(env);
+out_free:
        OBD_FREE_PTR(env);
        return rc;
 }
@@ -612,7 +611,7 @@ static void qmt_id_lock_glimpse(const struct lu_env *env,
 
        lquota_generate_fid(&qti->qti_fid, pool->qpi_key & 0x0000ffff,
                            pool->qpi_key >> 16, lqe->lqe_site->lqs_qtype);
-       fid_build_quota_resid(&qti->qti_fid, &lqe->lqe_id, &qti->qti_resid);
+       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);
        if (res == NULL) {
index 66fa4b8..eaf46d2 100644 (file)
@@ -260,8 +260,8 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp,
                break;
        case IT_QUOTA_DQACQ:
                /* build resource name associated for per-ID quota lock */
-               fid_build_quota_resid(&qbody->qb_fid, &qbody->qb_id,
-                                     &qti->qti_resid);
+               fid_build_quota_res_name(&qbody->qb_fid, &qbody->qb_id,
+                                        &qti->qti_resid);
 
                /* copy einfo template and fill ei_cbdata with lqe pointer */
                memcpy(&qti->qti_einfo, &qsd_id_einfo, sizeof(qti->qti_einfo));