From: tappro Date: Fri, 26 Jun 2009 17:48:12 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_220~84 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2dc83b90b872d284680652a29797e595274ab7e5 Branch HEAD b=19550 i=rread i=zam Add lock counter to export and output it in dump_exports --- diff --git a/lustre/include/lustre_export.h b/lustre/include/lustre_export.h index d78a26d..710f13c 100644 --- a/lustre/include/lustre_export.h +++ b/lustre/include/lustre_export.h @@ -145,6 +145,7 @@ struct obd_export { atomic_t exp_refcount; atomic_t exp_rpc_count; atomic_t exp_cb_count; + atomic_t exp_locks_count; struct obd_uuid exp_client_uuid; struct list_head exp_obd_chain; struct hlist_node exp_uuid_hash; /* uuid-export hash*/ diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 3792a4f..3e4f1ac 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -164,6 +164,8 @@ void ldlm_lock_put(struct ldlm_lock *lock) ldlm_resource_putref(res); lock->l_resource = NULL; if (lock->l_export) { + LASSERT(atomic_read(&lock->l_export->exp_locks_count) > 0); + atomic_dec(&lock->l_export->exp_locks_count); class_export_put(lock->l_export); lock->l_export = NULL; } diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 82c37cf..8271bee 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -1110,7 +1110,7 @@ int ldlm_handle_enqueue0(struct ldlm_namespace *ns, GOTO(out, rc = -ENOTCONN); } lock->l_export = class_export_get(req->rq_export); - + atomic_inc(&lock->l_export->exp_locks_count); if (lock->l_export->exp_lock_hash) lustre_hash_add(lock->l_export->exp_lock_hash, &lock->l_remote_handle, diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 7178463..627261d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -3188,6 +3188,8 @@ int mdt_intent_lock_replace(struct mdt_thread_info *info, } new_lock->l_export = class_export_get(req->rq_export); + atomic_inc(&lock->l_export->exp_locks_count); + new_lock->l_blocking_ast = lock->l_blocking_ast; new_lock->l_completion_ast = lock->l_completion_ast; new_lock->l_remote_handle = lock->l_remote_handle; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 4af4a61..f4099e0 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -782,6 +782,7 @@ struct obd_export *class_new_export(struct obd_device *obd, atomic_set(&export->exp_refcount, 2); atomic_set(&export->exp_rpc_count, 0); atomic_set(&export->exp_cb_count, 0); + atomic_set(&export->exp_locks_count, 0); export->exp_obd = obd; CFS_INIT_LIST_HEAD(&export->exp_outstanding_replies); spin_lock_init(&export->exp_uncommitted_replies_lock); @@ -1315,14 +1316,14 @@ static void print_export_data(struct obd_export *exp, const char *status) } spin_unlock(&exp->exp_lock); - CDEBUG(D_HA, "%s: %s %p %s %s %d %d %d: %p %s %d %d %d %d "LPU64"\n", + CDEBUG(D_HA, "%s: %s %p %s %s %d (%d %d %d) %d %d %d %d: %p %s "LPU64"\n", exp->exp_obd->obd_name, status, exp, exp->exp_client_uuid.uuid, obd_export_nid2str(exp), atomic_read(&exp->exp_refcount), - exp->exp_failed, nreplies, first_reply, - nreplies > 3 ? "..." : "", atomic_read(&exp->exp_rpc_count), atomic_read(&exp->exp_cb_count), - exp->exp_disconnected, exp->exp_delayed, + atomic_read(&exp->exp_locks_count), + exp->exp_disconnected, exp->exp_delayed, exp->exp_failed, + nreplies, first_reply, nreplies > 3 ? "..." : "", exp->exp_last_committed); }