aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/locking/dlm/thread.c')
-rw-r--r--fs/gfs2/locking/dlm/thread.c65
1 files changed, 29 insertions, 36 deletions
diff --git a/fs/gfs2/locking/dlm/thread.c b/fs/gfs2/locking/dlm/thread.c
index 22bbe6d3a5ae..6fe669cd334b 100644
--- a/fs/gfs2/locking/dlm/thread.c
+++ b/fs/gfs2/locking/dlm/thread.c
@@ -1,15 +1,11 @@
1/****************************************************************************** 1/*
2******************************************************************************* 2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3** 3 * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4 *
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 5 * This copyrighted material is made available to anyone wishing to use,
6** 6 * modify, copy, or redistribute it subject to the terms and conditions
7** This copyrighted material is made available to anyone wishing to use, 7 * of the GNU General Public License v.2.
8** modify, copy, or redistribute it subject to the terms and conditions 8 */
9** of the GNU General Public License v.2.
10**
11*******************************************************************************
12******************************************************************************/
13 9
14#include "lock_dlm.h" 10#include "lock_dlm.h"
15 11
@@ -26,15 +22,10 @@ static void queue_submit(struct gdlm_lock *lp)
26 wake_up(&ls->thread_wait); 22 wake_up(&ls->thread_wait);
27} 23}
28 24
29static void process_submit(struct gdlm_lock *lp)
30{
31 gdlm_do_lock(lp, NULL);
32}
33
34static void process_blocking(struct gdlm_lock *lp, int bast_mode) 25static void process_blocking(struct gdlm_lock *lp, int bast_mode)
35{ 26{
36 struct gdlm_ls *ls = lp->ls; 27 struct gdlm_ls *ls = lp->ls;
37 unsigned int cb; 28 unsigned int cb = 0;
38 29
39 switch (gdlm_make_lmstate(bast_mode)) { 30 switch (gdlm_make_lmstate(bast_mode)) {
40 case LM_ST_EXCLUSIVE: 31 case LM_ST_EXCLUSIVE:
@@ -47,7 +38,7 @@ static void process_blocking(struct gdlm_lock *lp, int bast_mode)
47 cb = LM_CB_NEED_S; 38 cb = LM_CB_NEED_S;
48 break; 39 break;
49 default: 40 default:
50 GDLM_ASSERT(0, printk("unknown bast mode %u\n",lp->bast_mode);); 41 gdlm_assert(0, "unknown bast mode %u", lp->bast_mode);
51 } 42 }
52 43
53 ls->fscb(ls->fsdata, cb, &lp->lockname); 44 ls->fscb(ls->fsdata, cb, &lp->lockname);
@@ -62,9 +53,9 @@ static void process_complete(struct gdlm_lock *lp)
62 memset(&acb, 0, sizeof(acb)); 53 memset(&acb, 0, sizeof(acb));
63 54
64 if (lp->lksb.sb_status == -DLM_ECANCEL) { 55 if (lp->lksb.sb_status == -DLM_ECANCEL) {
65 log_all("complete dlm cancel %x,%"PRIx64" flags %lx", 56 log_info("complete dlm cancel %x,%llx flags %lx",
66 lp->lockname.ln_type, lp->lockname.ln_number, 57 lp->lockname.ln_type, lp->lockname.ln_number,
67 lp->flags); 58 lp->flags);
68 59
69 lp->req = lp->cur; 60 lp->req = lp->cur;
70 acb.lc_ret |= LM_OUT_CANCELED; 61 acb.lc_ret |= LM_OUT_CANCELED;
@@ -75,9 +66,9 @@ static void process_complete(struct gdlm_lock *lp)
75 66
76 if (test_and_clear_bit(LFL_DLM_UNLOCK, &lp->flags)) { 67 if (test_and_clear_bit(LFL_DLM_UNLOCK, &lp->flags)) {
77 if (lp->lksb.sb_status != -DLM_EUNLOCK) { 68 if (lp->lksb.sb_status != -DLM_EUNLOCK) {
78 log_all("unlock sb_status %d %x,%"PRIx64" flags %lx", 69 log_info("unlock sb_status %d %x,%llx flags %lx",
79 lp->lksb.sb_status, lp->lockname.ln_type, 70 lp->lksb.sb_status, lp->lockname.ln_type,
80 lp->lockname.ln_number, lp->flags); 71 lp->lockname.ln_number, lp->flags);
81 return; 72 return;
82 } 73 }
83 74
@@ -108,8 +99,8 @@ static void process_complete(struct gdlm_lock *lp)
108 */ 99 */
109 100
110 if (test_and_clear_bit(LFL_CANCEL, &lp->flags)) { 101 if (test_and_clear_bit(LFL_CANCEL, &lp->flags)) {
111 log_all("complete internal cancel %x,%"PRIx64"", 102 log_info("complete internal cancel %x,%llx",
112 lp->lockname.ln_type, lp->lockname.ln_number); 103 lp->lockname.ln_type, lp->lockname.ln_number);
113 lp->req = lp->cur; 104 lp->req = lp->cur;
114 acb.lc_ret |= LM_OUT_CANCELED; 105 acb.lc_ret |= LM_OUT_CANCELED;
115 goto out; 106 goto out;
@@ -130,9 +121,9 @@ static void process_complete(struct gdlm_lock *lp)
130 } 121 }
131 122
132 /* this could only happen with cancels I think */ 123 /* this could only happen with cancels I think */
133 log_all("ast sb_status %d %x,%"PRIx64" flags %lx", 124 log_info("ast sb_status %d %x,%llx flags %lx",
134 lp->lksb.sb_status, lp->lockname.ln_type, 125 lp->lksb.sb_status, lp->lockname.ln_type,
135 lp->lockname.ln_number, lp->flags); 126 lp->lockname.ln_number, lp->flags);
136 return; 127 return;
137 } 128 }
138 129
@@ -152,8 +143,10 @@ static void process_complete(struct gdlm_lock *lp)
152 */ 143 */
153 144
154 if (test_and_clear_bit(LFL_REREQUEST, &lp->flags)) { 145 if (test_and_clear_bit(LFL_REREQUEST, &lp->flags)) {
155 GDLM_ASSERT(lp->req == DLM_LOCK_NL,); 146 gdlm_assert(lp->req == DLM_LOCK_NL, "%x,%llx",
156 GDLM_ASSERT(lp->prev_req > DLM_LOCK_NL,); 147 lp->lockname.ln_type, lp->lockname.ln_number);
148 gdlm_assert(lp->prev_req > DLM_LOCK_NL, "%x,%llx",
149 lp->lockname.ln_type, lp->lockname.ln_number);
157 150
158 lp->cur = DLM_LOCK_NL; 151 lp->cur = DLM_LOCK_NL;
159 lp->req = lp->prev_req; 152 lp->req = lp->prev_req;
@@ -189,7 +182,7 @@ static void process_complete(struct gdlm_lock *lp)
189 lp->lkf |= DLM_LKF_CONVERT; 182 lp->lkf |= DLM_LKF_CONVERT;
190 lp->lkf &= ~DLM_LKF_CONVDEADLK; 183 lp->lkf &= ~DLM_LKF_CONVDEADLK;
191 184
192 log_debug("rereq %x,%"PRIx64" id %x %d,%d", 185 log_debug("rereq %x,%llx id %x %d,%d",
193 lp->lockname.ln_type, lp->lockname.ln_number, 186 lp->lockname.ln_type, lp->lockname.ln_number,
194 lp->lksb.sb_lkid, lp->cur, lp->req); 187 lp->lksb.sb_lkid, lp->cur, lp->req);
195 188
@@ -315,7 +308,7 @@ static int gdlm_thread(void *data)
315 process_blocking(lp, blocking); 308 process_blocking(lp, blocking);
316 309
317 else if (submit) 310 else if (submit)
318 process_submit(lp); 311 gdlm_do_lock(lp, NULL);
319 312
320 if (drop) 313 if (drop)
321 ls->fscb(ls->fsdata, LM_CB_DROPLOCKS, NULL); 314 ls->fscb(ls->fsdata, LM_CB_DROPLOCKS, NULL);
@@ -334,7 +327,7 @@ int gdlm_init_threads(struct gdlm_ls *ls)
334 p = kthread_run(gdlm_thread, ls, "lock_dlm1"); 327 p = kthread_run(gdlm_thread, ls, "lock_dlm1");
335 error = IS_ERR(p); 328 error = IS_ERR(p);
336 if (error) { 329 if (error) {
337 log_all("can't start lock_dlm1 thread %d", error); 330 log_error("can't start lock_dlm1 thread %d", error);
338 return error; 331 return error;
339 } 332 }
340 ls->thread1 = p; 333 ls->thread1 = p;
@@ -342,7 +335,7 @@ int gdlm_init_threads(struct gdlm_ls *ls)
342 p = kthread_run(gdlm_thread, ls, "lock_dlm2"); 335 p = kthread_run(gdlm_thread, ls, "lock_dlm2");
343 error = IS_ERR(p); 336 error = IS_ERR(p);
344 if (error) { 337 if (error) {
345 log_all("can't start lock_dlm2 thread %d", error); 338 log_error("can't start lock_dlm2 thread %d", error);
346 kthread_stop(ls->thread1); 339 kthread_stop(ls->thread1);
347 return error; 340 return error;
348 } 341 }