aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r--fs/gfs2/locking/dlm/lock.c14
-rw-r--r--fs/gfs2/locking/dlm/lock_dlm.h3
2 files changed, 8 insertions, 9 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index b167addf9fd1..c305255bfe8a 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -151,7 +151,7 @@ static inline unsigned int make_flags(struct gdlm_lock *lp,
151 151
152/* make_strname - convert GFS lock numbers to a string */ 152/* make_strname - convert GFS lock numbers to a string */
153 153
154static inline void make_strname(struct lm_lockname *lockname, 154static inline void make_strname(const struct lm_lockname *lockname,
155 struct gdlm_strname *str) 155 struct gdlm_strname *str)
156{ 156{
157 sprintf(str->name, "%8x%16llx", lockname->ln_type, 157 sprintf(str->name, "%8x%16llx", lockname->ln_type,
@@ -169,6 +169,7 @@ static int gdlm_create_lp(struct gdlm_ls *ls, struct lm_lockname *name,
169 return -ENOMEM; 169 return -ENOMEM;
170 170
171 lp->lockname = *name; 171 lp->lockname = *name;
172 make_strname(name, &lp->strname);
172 lp->ls = ls; 173 lp->ls = ls;
173 lp->cur = DLM_LOCK_IV; 174 lp->cur = DLM_LOCK_IV;
174 lp->lvb = NULL; 175 lp->lvb = NULL;
@@ -227,7 +228,6 @@ void gdlm_put_lock(void *lock)
227unsigned int gdlm_do_lock(struct gdlm_lock *lp) 228unsigned int gdlm_do_lock(struct gdlm_lock *lp)
228{ 229{
229 struct gdlm_ls *ls = lp->ls; 230 struct gdlm_ls *ls = lp->ls;
230 struct gdlm_strname str;
231 int error, bast = 1; 231 int error, bast = 1;
232 232
233 /* 233 /*
@@ -249,8 +249,6 @@ unsigned int gdlm_do_lock(struct gdlm_lock *lp)
249 if (test_bit(LFL_NOBAST, &lp->flags)) 249 if (test_bit(LFL_NOBAST, &lp->flags))
250 bast = 0; 250 bast = 0;
251 251
252 make_strname(&lp->lockname, &str);
253
254 set_bit(LFL_ACTIVE, &lp->flags); 252 set_bit(LFL_ACTIVE, &lp->flags);
255 253
256 log_debug("lk %x,%llx id %x %d,%d %x", lp->lockname.ln_type, 254 log_debug("lk %x,%llx id %x %d,%d %x", lp->lockname.ln_type,
@@ -258,8 +256,8 @@ unsigned int gdlm_do_lock(struct gdlm_lock *lp)
258 lp->cur, lp->req, lp->lkf); 256 lp->cur, lp->req, lp->lkf);
259 257
260 error = dlm_lock(ls->dlm_lockspace, lp->req, &lp->lksb, lp->lkf, 258 error = dlm_lock(ls->dlm_lockspace, lp->req, &lp->lksb, lp->lkf,
261 str.name, str.namelen, 0, gdlm_ast, lp, 259 lp->strname.name, lp->strname.namelen, 0, gdlm_ast,
262 bast ? gdlm_bast : NULL); 260 lp, bast ? gdlm_bast : NULL);
263 261
264 if ((error == -EAGAIN) && (lp->lkf & DLM_LKF_NOQUEUE)) { 262 if ((error == -EAGAIN) && (lp->lkf & DLM_LKF_NOQUEUE)) {
265 lp->lksb.sb_status = -EAGAIN; 263 lp->lksb.sb_status = -EAGAIN;
@@ -268,7 +266,7 @@ unsigned int gdlm_do_lock(struct gdlm_lock *lp)
268 } 266 }
269 267
270 if (error) { 268 if (error) {
271 log_debug("%s: gdlm_lock %x,%llx err=%d cur=%d req=%d lkf=%x " 269 log_error("%s: gdlm_lock %x,%llx err=%d cur=%d req=%d lkf=%x "
272 "flags=%lx", ls->fsname, lp->lockname.ln_type, 270 "flags=%lx", ls->fsname, lp->lockname.ln_type,
273 (unsigned long long)lp->lockname.ln_number, error, 271 (unsigned long long)lp->lockname.ln_number, error,
274 lp->cur, lp->req, lp->lkf, lp->flags); 272 lp->cur, lp->req, lp->lkf, lp->flags);
@@ -296,7 +294,7 @@ static unsigned int gdlm_do_unlock(struct gdlm_lock *lp)
296 error = dlm_unlock(ls->dlm_lockspace, lp->lksb.sb_lkid, lkf, NULL, lp); 294 error = dlm_unlock(ls->dlm_lockspace, lp->lksb.sb_lkid, lkf, NULL, lp);
297 295
298 if (error) { 296 if (error) {
299 log_debug("%s: gdlm_unlock %x,%llx err=%d cur=%d req=%d lkf=%x " 297 log_error("%s: gdlm_unlock %x,%llx err=%d cur=%d req=%d lkf=%x "
300 "flags=%lx", ls->fsname, lp->lockname.ln_type, 298 "flags=%lx", ls->fsname, lp->lockname.ln_type,
301 (unsigned long long)lp->lockname.ln_number, error, 299 (unsigned long long)lp->lockname.ln_number, error,
302 lp->cur, lp->req, lp->lkf, lp->flags); 300 lp->cur, lp->req, lp->lkf, lp->flags);
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h
index a87c7bf3c568..d074c6e6f9bf 100644
--- a/fs/gfs2/locking/dlm/lock_dlm.h
+++ b/fs/gfs2/locking/dlm/lock_dlm.h
@@ -36,7 +36,7 @@
36 36
37#define GDLM_STRNAME_BYTES 24 37#define GDLM_STRNAME_BYTES 24
38#define GDLM_LVB_SIZE 32 38#define GDLM_LVB_SIZE 32
39#define GDLM_DROP_COUNT 200000 39#define GDLM_DROP_COUNT 0
40#define GDLM_DROP_PERIOD 60 40#define GDLM_DROP_PERIOD 60
41#define GDLM_NAME_LEN 128 41#define GDLM_NAME_LEN 128
42 42
@@ -106,6 +106,7 @@ enum {
106struct gdlm_lock { 106struct gdlm_lock {
107 struct gdlm_ls *ls; 107 struct gdlm_ls *ls;
108 struct lm_lockname lockname; 108 struct lm_lockname lockname;
109 struct gdlm_strname strname;
109 char *lvb; 110 char *lvb;
110 struct dlm_lksb lksb; 111 struct dlm_lksb lksb;
111 112