From 55cde1d4c3a84f19db7e86398518a82a8b2587ef Mon Sep 17 00:00:00 2001 From: huanghua Date: Thu, 12 Feb 2009 01:38:56 +0000 Subject: [PATCH] Branch HEAD b=11404 i=yong.fan i=rahul.deshmukh more debugging code. --- lustre/cmm/cmm_object.c | 3 ++- lustre/mdd/mdd_object.c | 6 +++++- lustre/mdt/mdt_handler.c | 11 ++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lustre/cmm/cmm_object.c b/lustre/cmm/cmm_object.c index bb5fd76..6f5a78a 100644 --- a/lustre/cmm/cmm_object.c +++ b/lustre/cmm/cmm_object.c @@ -837,7 +837,8 @@ static int cmr_object_init(const struct lu_env *env, struct lu_object *lo, static int cmr_object_print(const struct lu_env *env, void *cookie, lu_printer_t p, const struct lu_object *lo) { - return (*p)(env, cookie, "[remote]"); + const struct cmr_object *cro = lu2cmr_obj((struct lu_object *)lo); + return (*p)(env, cookie, "[remote](mds_num=%d)", cro->cmo_num); } static const struct lu_object_operations cmr_obj_ops = { diff --git a/lustre/mdd/mdd_object.c b/lustre/mdd/mdd_object.c index a2ce991..c6bc349 100644 --- a/lustre/mdd/mdd_object.c +++ b/lustre/mdd/mdd_object.c @@ -304,7 +304,11 @@ static void mdd_object_free(const struct lu_env *env, struct lu_object *o) static int mdd_object_print(const struct lu_env *env, void *cookie, lu_printer_t p, const struct lu_object *o) { - return (*p)(env, cookie, LUSTRE_MDD_NAME"-object@%p", o); + struct mdd_object *mdd = lu2mdd_obj((struct lu_object *)o); + return (*p)(env, cookie, LUSTRE_MDD_NAME"-object@%p(open_count=%d, " + "valid=%x, cltime=%llu, flags=%lx", + mdd, mdd->mod_count, mdd->mod_valid, + mdd->mod_cltime, mdd->mod_flags); } static const struct lu_object_operations mdd_lu_obj_ops = { diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index f95d6b4..d164c65 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -4722,6 +4722,14 @@ static void mdt_object_free(const struct lu_env *env, struct lu_object *o) EXIT; } +static int mdt_object_print(const struct lu_env *env, void *cookie, + lu_printer_t p, const struct lu_object *o) +{ + struct mdt_object *mdto = mdt_obj((struct lu_object *)o); + return (*p)(env, cookie, LUSTRE_MDT_NAME"-object@%p(ioepoch=%llu " + "flags=%llx)", mdto, mdto->mot_ioepoch, mdto->mot_flags); +} + static const struct lu_device_operations mdt_lu_ops = { .ldo_object_alloc = mdt_object_alloc, .ldo_process_config = mdt_process_config, @@ -4729,7 +4737,8 @@ static const struct lu_device_operations mdt_lu_ops = { static const struct lu_object_operations mdt_obj_ops = { .loo_object_init = mdt_object_init, - .loo_object_free = mdt_object_free + .loo_object_free = mdt_object_free, + .loo_object_print = mdt_object_print }; static int mdt_obd_set_info_async(struct obd_export *exp, -- 1.8.3.1