aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:26:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:26:27 -0400
commit5cefcab3db2b13093480f2a42bf081574dd72d3d (patch)
treec3755a241553436a1b84d65ad3c00f77ce6d02ad /fs/gfs2/locking
parent5f757f91e70a97eda8f0cc13bddc853209b2d173 (diff)
parent37fde8ca6c60ea61f5e9d7cb877c25ac60e74167 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (34 commits) [GFS2] Uncomment sprintf_symbol calling code [DLM] lowcomms style [GFS2] printk warning fixes [GFS2] Patch to fix mmap of stuffed files [GFS2] use lib/parser for parsing mount options [DLM] Lowcomms nodeid range & initialisation fixes [DLM] Fix dlm_lowcoms_stop hang [DLM] fix mode munging [GFS2] lockdump improvements [GFS2] Patch to detect corrupt number of dir entries in leaf and/or inode blocks [GFS2] bz 236008: Kernel gpf doing cat /debugfs/gfs2/xxx (lock dump) [DLM] fs/dlm/ast.c should #include "ast.h" [DLM] Consolidate transport protocols [DLM] Remove redundant assignment [GFS2] Fix bz 234168 (ignoring rgrp flags) [DLM] change lkid format [DLM] interface for purge (2/2) [DLM] add orphan purging code (1/2) [DLM] split create_message function [GFS2] Set drop_count to 0 (off) by default ...
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