aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2012-10-15 05:57:02 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-11-07 08:31:07 -0500
commit8eae1ca0034cce78a24738087a32adb1ddb66aa7 (patch)
treef43287fa4232a5fdcf78eb74a004ec986c261807 /fs/gfs2/glock.c
parent0e4a43ed08e2f44aa7b96aa95d0a540d675483e1 (diff)
GFS2: Review bug traps in glops.c
Two of the bug traps here could really be warnings. The others are converted from BUG() to GLOCK_BUG_ON() since we'll most likely need to know the glock state in order to debug any issues which arise. As a result of this, __dump_glock has to be renamed and is no longer static. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index e6c2fd53cab2..e543871ec82f 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -55,8 +55,6 @@ struct gfs2_glock_iter {
55 55
56typedef void (*glock_examiner) (struct gfs2_glock * gl); 56typedef void (*glock_examiner) (struct gfs2_glock * gl);
57 57
58static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl);
59#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { __dump_glock(NULL, gl); BUG(); } } while(0)
60static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target); 58static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target);
61 59
62static struct dentry *gfs2_root; 60static struct dentry *gfs2_root;
@@ -1013,7 +1011,7 @@ trap_recursive:
1013 printk(KERN_ERR "pid: %d\n", pid_nr(gh->gh_owner_pid)); 1011 printk(KERN_ERR "pid: %d\n", pid_nr(gh->gh_owner_pid));
1014 printk(KERN_ERR "lock type: %d req lock state : %d\n", 1012 printk(KERN_ERR "lock type: %d req lock state : %d\n",
1015 gh->gh_gl->gl_name.ln_type, gh->gh_state); 1013 gh->gh_gl->gl_name.ln_type, gh->gh_state);
1016 __dump_glock(NULL, gl); 1014 gfs2_dump_glock(NULL, gl);
1017 BUG(); 1015 BUG();
1018} 1016}
1019 1017
@@ -1508,7 +1506,7 @@ static int dump_glock(struct seq_file *seq, struct gfs2_glock *gl)
1508{ 1506{
1509 int ret; 1507 int ret;
1510 spin_lock(&gl->gl_spin); 1508 spin_lock(&gl->gl_spin);
1511 ret = __dump_glock(seq, gl); 1509 ret = gfs2_dump_glock(seq, gl);
1512 spin_unlock(&gl->gl_spin); 1510 spin_unlock(&gl->gl_spin);
1513 return ret; 1511 return ret;
1514} 1512}
@@ -1655,7 +1653,7 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
1655} 1653}
1656 1654
1657/** 1655/**
1658 * __dump_glock - print information about a glock 1656 * gfs2_dump_glock - print information about a glock
1659 * @seq: The seq_file struct 1657 * @seq: The seq_file struct
1660 * @gl: the glock 1658 * @gl: the glock
1661 * 1659 *
@@ -1672,7 +1670,7 @@ static const char *gflags2str(char *buf, const struct gfs2_glock *gl)
1672 * Returns: 0 on success, -ENOBUFS when we run out of space 1670 * Returns: 0 on success, -ENOBUFS when we run out of space
1673 */ 1671 */
1674 1672
1675static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl) 1673int gfs2_dump_glock(struct seq_file *seq, const struct gfs2_glock *gl)
1676{ 1674{
1677 const struct gfs2_glock_operations *glops = gl->gl_ops; 1675 const struct gfs2_glock_operations *glops = gl->gl_ops;
1678 unsigned long long dtime; 1676 unsigned long long dtime;