提交 29004858 编写于 作者: K Kurt Hackel 提交者: Mark Fasheh

ocfs2: don't use MLF* in dlm/ files

Signed-off-by: NKurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
上级 70bacbdb
...@@ -307,8 +307,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -307,8 +307,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
if (past->type != DLM_AST && if (past->type != DLM_AST &&
past->type != DLM_BAST) { past->type != DLM_BAST) {
mlog(ML_ERROR, "Unknown ast type! %d, cookie=%"MLFu64", " mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu"
"name=%.*s\n", past->type, cookie, locklen, name); "name=%.*s\n", past->type,
dlm_get_lock_cookie_node(cookie),
dlm_get_lock_cookie_seq(cookie),
locklen, name);
ret = DLM_IVLOCKID; ret = DLM_IVLOCKID;
goto leave; goto leave;
} }
...@@ -316,9 +319,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -316,9 +319,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
res = dlm_lookup_lockres(dlm, name, locklen); res = dlm_lookup_lockres(dlm, name, locklen);
if (!res) { if (!res) {
mlog(ML_ERROR, "got %sast for unknown lockres! " mlog(ML_ERROR, "got %sast for unknown lockres! "
"cookie=%"MLFu64", name=%.*s, namelen=%u\n", "cookie=%u:%llu, name=%.*s, namelen=%u\n",
past->type == DLM_AST ? "" : "b", past->type == DLM_AST ? "" : "b",
cookie, locklen, name, locklen); dlm_get_lock_cookie_node(cookie),
dlm_get_lock_cookie_seq(cookie),
locklen, name, locklen);
ret = DLM_IVLOCKID; ret = DLM_IVLOCKID;
goto leave; goto leave;
} }
...@@ -360,9 +365,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -360,9 +365,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
goto do_ast; goto do_ast;
} }
mlog(ML_ERROR, "got %sast for unknown lock! cookie=%"MLFu64", " mlog(ML_ERROR, "got %sast for unknown lock! cookie=%u:%llu, "
"name=%.*s, namelen=%u\n", "name=%.*s, namelen=%u\n",
past->type == DLM_AST ? "" : "b", cookie, locklen, name, locklen); past->type == DLM_AST ? "" : "b",
dlm_get_lock_cookie_node(cookie),
dlm_get_lock_cookie_seq(cookie),
locklen, name, locklen);
ret = DLM_NORMAL; ret = DLM_NORMAL;
unlock_out: unlock_out:
......
...@@ -630,6 +630,21 @@ __dlm_lockres_state_to_status(struct dlm_lock_resource *res) ...@@ -630,6 +630,21 @@ __dlm_lockres_state_to_status(struct dlm_lock_resource *res)
return status; return status;
} }
static inline u8 dlm_get_lock_cookie_node(u64 cookie)
{
u8 ret;
cookie >>= 56;
ret = (u8)(cookie & 0xffULL);
return ret;
}
static inline unsigned long long dlm_get_lock_cookie_seq(u64 cookie)
{
unsigned long long ret;
ret = ((unsigned long long)cookie) & 0x00ffffffffffffffULL;
return ret;
}
struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie, struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie,
struct dlm_lockstatus *lksb); struct dlm_lockstatus *lksb);
void dlm_lock_get(struct dlm_lock *lock); void dlm_lock_get(struct dlm_lock *lock);
......
...@@ -284,8 +284,10 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm, ...@@ -284,8 +284,10 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm,
if (lock->ml.convert_type != LKM_IVMODE) { if (lock->ml.convert_type != LKM_IVMODE) {
__dlm_print_one_lock_resource(res); __dlm_print_one_lock_resource(res);
mlog(ML_ERROR, "converting a remote lock that is already " mlog(ML_ERROR, "converting a remote lock that is already "
"converting! (cookie=%"MLFu64", conv=%d)\n", "converting! (cookie=%u:%llu, conv=%d)\n",
lock->ml.cookie, lock->ml.convert_type); dlm_get_lock_cookie_node(lock->ml.cookie),
dlm_get_lock_cookie_seq(lock->ml.cookie),
lock->ml.convert_type);
status = DLM_DENIED; status = DLM_DENIED;
goto bail; goto bail;
} }
...@@ -513,8 +515,9 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -513,8 +515,9 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
leave: leave:
if (!lock) if (!lock)
mlog(ML_ERROR, "did not find lock to convert on grant queue! " mlog(ML_ERROR, "did not find lock to convert on grant queue! "
"cookie=%"MLFu64"\n", "cookie=%u:%llu\n",
cnv->cookie); dlm_get_lock_cookie_node(cnv->cookie),
dlm_get_lock_cookie_seq(cnv->cookie));
else else
dlm_lock_put(lock); dlm_lock_put(lock);
......
...@@ -72,8 +72,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) ...@@ -72,8 +72,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
lock = list_entry(iter2, struct dlm_lock, list); lock = list_entry(iter2, struct dlm_lock, list);
spin_lock(&lock->spinlock); spin_lock(&lock->spinlock);
mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, "
"cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n",
lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, lock->ml.type, lock->ml.convert_type, lock->ml.node,
dlm_get_lock_cookie_node(lock->ml.cookie),
dlm_get_lock_cookie_seq(lock->ml.cookie),
list_empty(&lock->ast_list) ? 'y' : 'n', list_empty(&lock->ast_list) ? 'y' : 'n',
lock->ast_pending ? 'y' : 'n', lock->ast_pending ? 'y' : 'n',
list_empty(&lock->bast_list) ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n',
...@@ -85,8 +87,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) ...@@ -85,8 +87,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
lock = list_entry(iter2, struct dlm_lock, list); lock = list_entry(iter2, struct dlm_lock, list);
spin_lock(&lock->spinlock); spin_lock(&lock->spinlock);
mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, "
"cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n",
lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, lock->ml.type, lock->ml.convert_type, lock->ml.node,
dlm_get_lock_cookie_node(lock->ml.cookie),
dlm_get_lock_cookie_seq(lock->ml.cookie),
list_empty(&lock->ast_list) ? 'y' : 'n', list_empty(&lock->ast_list) ? 'y' : 'n',
lock->ast_pending ? 'y' : 'n', lock->ast_pending ? 'y' : 'n',
list_empty(&lock->bast_list) ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n',
...@@ -98,8 +102,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res) ...@@ -98,8 +102,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
lock = list_entry(iter2, struct dlm_lock, list); lock = list_entry(iter2, struct dlm_lock, list);
spin_lock(&lock->spinlock); spin_lock(&lock->spinlock);
mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, " mlog(ML_NOTICE, " type=%d, conv=%d, node=%u, "
"cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n",
lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, lock->ml.type, lock->ml.convert_type, lock->ml.node,
dlm_get_lock_cookie_node(lock->ml.cookie),
dlm_get_lock_cookie_seq(lock->ml.cookie),
list_empty(&lock->ast_list) ? 'y' : 'n', list_empty(&lock->ast_list) ? 'y' : 'n',
lock->ast_pending ? 'y' : 'n', lock->ast_pending ? 'y' : 'n',
list_empty(&lock->bast_list) ? 'y' : 'n', list_empty(&lock->bast_list) ? 'y' : 'n',
......
...@@ -744,10 +744,12 @@ static void dlm_request_all_locks_worker(struct dlm_work_item *item, void *data) ...@@ -744,10 +744,12 @@ static void dlm_request_all_locks_worker(struct dlm_work_item *item, void *data)
dlm->name, dlm->reco.dead_node, dlm->reco.new_master, dlm->name, dlm->reco.dead_node, dlm->reco.new_master,
dead_node, reco_master); dead_node, reco_master);
mlog(ML_ERROR, "%s: name=%.*s master=%u locks=%u/%u flags=%u " mlog(ML_ERROR, "%s: name=%.*s master=%u locks=%u/%u flags=%u "
"entry[0]={c=%"MLFu64",l=%u,f=%u,t=%d,ct=%d,hb=%d,n=%u}\n", "entry[0]={c=%u:%llu,l=%u,f=%u,t=%d,ct=%d,hb=%d,n=%u}\n",
dlm->name, mres->lockname_len, mres->lockname, mres->master, dlm->name, mres->lockname_len, mres->lockname, mres->master,
mres->num_locks, mres->total_locks, mres->flags, mres->num_locks, mres->total_locks, mres->flags,
mres->ml[0].cookie, mres->ml[0].list, mres->ml[0].flags, dlm_get_lock_cookie_node(mres->ml[0].cookie),
dlm_get_lock_cookie_seq(mres->ml[0].cookie),
mres->ml[0].list, mres->ml[0].flags,
mres->ml[0].type, mres->ml[0].convert_type, mres->ml[0].type, mres->ml[0].convert_type,
mres->ml[0].highest_blocked, mres->ml[0].node); mres->ml[0].highest_blocked, mres->ml[0].node);
BUG(); BUG();
...@@ -1513,9 +1515,11 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm, ...@@ -1513,9 +1515,11 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
/* lock is always created locally first, and /* lock is always created locally first, and
* destroyed locally last. it must be on the list */ * destroyed locally last. it must be on the list */
if (!lock) { if (!lock) {
u64 c = ml->cookie;
mlog(ML_ERROR, "could not find local lock " mlog(ML_ERROR, "could not find local lock "
"with cookie %"MLFu64"!\n", "with cookie %u:%llu!\n",
ml->cookie); dlm_get_lock_cookie_node(c),
dlm_get_lock_cookie_seq(c));
BUG(); BUG();
} }
BUG_ON(lock->ml.node != ml->node); BUG_ON(lock->ml.node != ml->node);
......
...@@ -244,8 +244,10 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, ...@@ -244,8 +244,10 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
if (actions & DLM_UNLOCK_FREE_LOCK) { if (actions & DLM_UNLOCK_FREE_LOCK) {
/* this should always be coupled with list removal */ /* this should always be coupled with list removal */
BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK)); BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK));
mlog(0, "lock %"MLFu64" should be gone now! refs=%d\n", mlog(0, "lock %u:%llu should be gone now! refs=%d\n",
lock->ml.cookie, atomic_read(&lock->lock_refs.refcount)-1); dlm_get_lock_cookie_node(lock->ml.cookie),
dlm_get_lock_cookie_seq(lock->ml.cookie),
atomic_read(&lock->lock_refs.refcount)-1);
dlm_lock_put(lock); dlm_lock_put(lock);
} }
if (actions & DLM_UNLOCK_CALL_AST) if (actions & DLM_UNLOCK_CALL_AST)
...@@ -493,8 +495,9 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -493,8 +495,9 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data)
not_found: not_found:
if (!found) if (!found)
mlog(ML_ERROR, "failed to find lock to unlock! " mlog(ML_ERROR, "failed to find lock to unlock! "
"cookie=%"MLFu64"\n", "cookie=%u:%llu\n",
unlock->cookie); dlm_get_lock_cookie_node(unlock->cookie),
dlm_get_lock_cookie_seq(unlock->cookie));
else { else {
/* send the lksb->status back to the other node */ /* send the lksb->status back to the other node */
status = lksb->status; status = lksb->status;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册