]> err.no Git - linux-2.6/commitdiff
ocfs2: don't use MLF* in dlm/ files
authorKurt Hackel <kurt.hackel@oracle.com>
Fri, 3 Mar 2006 00:43:36 +0000 (16:43 -0800)
committerMark Fasheh <mark.fasheh@oracle.com>
Fri, 24 Mar 2006 22:58:27 +0000 (14:58 -0800)
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/dlm/dlmast.c
fs/ocfs2/dlm/dlmcommon.h
fs/ocfs2/dlm/dlmconvert.c
fs/ocfs2/dlm/dlmdebug.c
fs/ocfs2/dlm/dlmrecovery.c
fs/ocfs2/dlm/dlmunlock.c

index 8d17d28ef91c127122b9724b7b22a5eaa2889593..355593dd8ef8139a4c60126dcbac00da27105bc7 100644 (file)
@@ -307,8 +307,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
 
        if (past->type != DLM_AST &&
            past->type != DLM_BAST) {
-               mlog(ML_ERROR, "Unknown ast type! %d, cookie=%"MLFu64", "
-                    "name=%.*s\n", past->type, cookie, locklen, name);
+               mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu"
+                    "name=%.*s\n", past->type, 
+                    dlm_get_lock_cookie_node(cookie),
+                    dlm_get_lock_cookie_seq(cookie),
+                    locklen, name);
                ret = DLM_IVLOCKID;
                goto leave;
        }
@@ -316,9 +319,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
        res = dlm_lookup_lockres(dlm, name, locklen);
        if (!res) {
                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",
-                    cookie, locklen, name, locklen);
+                    dlm_get_lock_cookie_node(cookie),
+                    dlm_get_lock_cookie_seq(cookie),
+                    locklen, name, locklen);
                ret = DLM_IVLOCKID;
                goto leave;
        }
@@ -360,9 +365,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
                        goto do_ast;
        }
 
-       mlog(ML_ERROR, "got %sast for unknown lock!  cookie=%"MLFu64", "
-                      "name=%.*s, namelen=%u\n",
-             past->type == DLM_AST ? "" : "b", cookie, locklen, name, locklen);
+       mlog(ML_ERROR, "got %sast for unknown lock!  cookie=%u:%llu, "
+                      "name=%.*s, namelen=%u\n", 
+                      past->type == DLM_AST ? "" : "b", 
+                      dlm_get_lock_cookie_node(cookie),
+                      dlm_get_lock_cookie_seq(cookie),
+                      locklen, name, locklen);
 
        ret = DLM_NORMAL;
 unlock_out:
index a8aec9341347f18eeb77c6429e2716fb77de4755..88cc43df18f11205c7f11f7344fe4b4c14d19e8f 100644 (file)
@@ -630,6 +630,21 @@ __dlm_lockres_state_to_status(struct dlm_lock_resource *res)
        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_lockstatus *lksb);
 void dlm_lock_get(struct dlm_lock *lock);
index f66e2d818ccdefa2c4eb20625fc77d417e464e37..8285228d9e3778659df0ca4f5324b9108e941ac1 100644 (file)
@@ -284,8 +284,10 @@ enum dlm_status dlmconvert_remote(struct dlm_ctxt *dlm,
        if (lock->ml.convert_type != LKM_IVMODE) {
                __dlm_print_one_lock_resource(res);
                mlog(ML_ERROR, "converting a remote lock that is already "
-                    "converting! (cookie=%"MLFu64", conv=%d)\n",
-                    lock->ml.cookie, lock->ml.convert_type);
+                    "converting! (cookie=%u:%llu, conv=%d)\n",
+                    dlm_get_lock_cookie_node(lock->ml.cookie),
+                    dlm_get_lock_cookie_seq(lock->ml.cookie),
+                    lock->ml.convert_type);
                status = DLM_DENIED;
                goto bail;
        }
@@ -513,8 +515,9 @@ int dlm_convert_lock_handler(struct o2net_msg *msg, u32 len, void *data)
 leave:
        if (!lock)
                mlog(ML_ERROR, "did not find lock to convert on grant queue! "
-                              "cookie=%"MLFu64"\n",
-                    cnv->cookie);
+                              "cookie=%u:%llu\n",
+                              dlm_get_lock_cookie_node(cnv->cookie),
+                              dlm_get_lock_cookie_seq(cnv->cookie));
        else
                dlm_lock_put(lock);
 
index 54f61b76ab513266bb616a4ded9b4ddfd5dedda7..c7eae5d3324ea833192f74aefc2a69e5dd5db72a 100644 (file)
@@ -72,8 +72,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                lock = list_entry(iter2, struct dlm_lock, list);
                spin_lock(&lock->spinlock);
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
-                      "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
-                      lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, 
+                      "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
+                      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',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
@@ -85,8 +87,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                lock = list_entry(iter2, struct dlm_lock, list);
                spin_lock(&lock->spinlock);
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
-                      "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
-                      lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, 
+                      "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
+                      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',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
@@ -98,8 +102,10 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                lock = list_entry(iter2, struct dlm_lock, list);
                spin_lock(&lock->spinlock);
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
-                      "cookie=%"MLFu64", ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
-                      lock->ml.type, lock->ml.convert_type, lock->ml.node, lock->ml.cookie, 
+                      "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
+                      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',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
index 36610bdf12311a54f17339e0a66586929257d038..805cbabac051d5007c492ac5de04f4f81c84e832 100644 (file)
@@ -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,
                     dead_node, reco_master);
                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,
                     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].highest_blocked, mres->ml[0].node);
                BUG();
@@ -1513,9 +1515,11 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
                        /* lock is always created locally first, and
                         * destroyed locally last.  it must be on the list */
                        if (!lock) {
+                               u64 c = ml->cookie;
                                mlog(ML_ERROR, "could not find local lock "
-                                              "with cookie %"MLFu64"!\n",
-                                    ml->cookie);
+                                              "with cookie %u:%llu!\n",
+                                              dlm_get_lock_cookie_node(c),
+                                              dlm_get_lock_cookie_seq(c));
                                BUG();
                        }
                        BUG_ON(lock->ml.node != ml->node);
index c95f08d2e925493fba9ab0a690769cfdda8243e3..7b1a275426744d373accbcb22c11ebe49e6a01a1 100644 (file)
@@ -244,8 +244,10 @@ leave:
        if (actions & DLM_UNLOCK_FREE_LOCK) {
                /* this should always be coupled with list removal */
                BUG_ON(!(actions & DLM_UNLOCK_REMOVE_LOCK));
-               mlog(0, "lock %"MLFu64" should be gone now! refs=%d\n",
-                    lock->ml.cookie, atomic_read(&lock->lock_refs.refcount)-1);
+               mlog(0, "lock %u:%llu should be gone now! refs=%d\n",
+                    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);
        }
        if (actions & DLM_UNLOCK_CALL_AST)
@@ -493,8 +495,9 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data)
 not_found:
        if (!found)
                mlog(ML_ERROR, "failed to find lock to unlock! "
-                              "cookie=%"MLFu64"\n",
-                    unlock->cookie);
+                              "cookie=%u:%llu\n",
+                              dlm_get_lock_cookie_node(unlock->cookie),
+                              dlm_get_lock_cookie_seq(unlock->cookie));
        else {
                /* send the lksb->status back to the other node */
                status = lksb->status;