Whamcloud - gitweb
LU-2285 osp: Enhance pre-creation-related debug messages
authorLi Wei <wei.g.li@intel.com>
Sun, 25 Nov 2012 07:48:00 +0000 (15:48 +0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 27 Nov 2012 18:48:19 +0000 (13:48 -0500)
This patch adds a couple of debug messages to help diagnose osp's
pre-creation code.  It also fixes OBD names and print formats in a few
related messages.

Change-Id: Ide153834511360855f390e7f35e85a389d0bd4db
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/4668
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/osp/osp_dev.c
lustre/osp/osp_object.c
lustre/osp/osp_precreate.c

index 94f4d3f..58d7824 100644 (file)
@@ -172,6 +172,8 @@ static int osp_last_used_init(const struct lu_env *env, struct osp_device *m)
                if (rc)
                        GOTO(out, rc);
        }
+       CDEBUG(D_HA, "%s: Read last used ID: "LPU64"\n", m->opd_obd->obd_name,
+              le64_to_cpu(m->opd_last_used_id));
        RETURN(0);
 out:
        CERROR("%s: can't initialize lov_objid: %d\n",
index d2bcde5..d94b5b9 100644 (file)
@@ -288,6 +288,9 @@ static int osp_object_create(const struct lu_env *env, struct dt_object *dt,
        rc = dt_record_write(env, d->opd_last_used_file, &osi->osi_lb,
                             &osi->osi_off, th);
 
+       CDEBUG(D_HA, "%s: Wrote last used ID: "LPU64": %d\n",
+              d->opd_obd->obd_name, le64_to_cpu(d->opd_last_used_id), rc);
+
        RETURN(rc);
 }
 
index 4adf222..04f8682 100644 (file)
@@ -280,7 +280,8 @@ static int osp_precreate_send(struct osp_device *d)
        if (body == NULL)
                GOTO(out_req, rc = -EPROTO);
 
-       CDEBUG(D_HA, "new last_created %lu\n", (unsigned long) body->oa.o_id);
+       CDEBUG(D_HA, "%s: new last_created "LPU64"\n", d->opd_obd->obd_name,
+              body->oa.o_id);
        LASSERT(body->oa.o_id > d->opd_pre_used_id);
 
        diff = body->oa.o_id - d->opd_pre_last_created;
@@ -440,8 +441,8 @@ static int osp_precreate_cleanup_orphans(struct osp_device *d)
        d->opd_pre_grow_slow = 0;
        cfs_spin_unlock(&d->opd_pre_lock);
 
-       CDEBUG(D_HA, "Got last_id "LPU64" from OST, last_used is "LPU64
-              ", next "LPU64"\n", body->oa.o_id,
+       CDEBUG(D_HA, "%s: Got last_id "LPU64" from OST, last_used is "LPU64
+              ", pre_used "LPU64"\n", d->opd_obd->obd_name, body->oa.o_id,
               le64_to_cpu(d->opd_last_used_id), d->opd_pre_used_id);
 
 out: