aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2010-01-08 11:14:29 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2010-03-01 09:07:53 -0500
commitc1184f8ab7ea26681f3cab18284a870aad678b0f (patch)
treefec6b61ba9b1aa16aab0d1dfabf63a21bbe47ac7 /fs/gfs2/glock.c
parent009d851837ab26cab18adda6169a813f70b0b21b (diff)
GFS2: Remove loopy umount code
As a consequence of the previous patch, we can now remove the loop which used to be required due to the circular dependency between the inodes and glocks. Instead we can just invalidate the inodes, and then clear up any glocks which are left. Also we no longer need the rwsem since there is no longer any danger of the inode invalidation calling back into the glock code (and from there back into the inode code). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r--fs/gfs2/glock.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index dfb10a4d467e..4773f9098a41 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -19,7 +19,6 @@
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/wait.h> 20#include <linux/wait.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/rwsem.h>
23#include <asm/uaccess.h> 22#include <asm/uaccess.h>
24#include <linux/seq_file.h> 23#include <linux/seq_file.h>
25#include <linux/debugfs.h> 24#include <linux/debugfs.h>
@@ -60,7 +59,6 @@ static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl);
60#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { __dump_glock(NULL, gl); BUG(); } } while(0) 59#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { __dump_glock(NULL, gl); BUG(); } } while(0)
61static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target); 60static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target);
62 61
63static DECLARE_RWSEM(gfs2_umount_flush_sem);
64static struct dentry *gfs2_root; 62static struct dentry *gfs2_root;
65static struct workqueue_struct *glock_workqueue; 63static struct workqueue_struct *glock_workqueue;
66struct workqueue_struct *gfs2_delete_workqueue; 64struct workqueue_struct *gfs2_delete_workqueue;
@@ -714,7 +712,6 @@ static void glock_work_func(struct work_struct *work)
714 finish_xmote(gl, gl->gl_reply); 712 finish_xmote(gl, gl->gl_reply);
715 drop_ref = 1; 713 drop_ref = 1;
716 } 714 }
717 down_read(&gfs2_umount_flush_sem);
718 spin_lock(&gl->gl_spin); 715 spin_lock(&gl->gl_spin);
719 if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) && 716 if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
720 gl->gl_state != LM_ST_UNLOCKED && 717 gl->gl_state != LM_ST_UNLOCKED &&
@@ -727,7 +724,6 @@ static void glock_work_func(struct work_struct *work)
727 } 724 }
728 run_queue(gl, 0); 725 run_queue(gl, 0);
729 spin_unlock(&gl->gl_spin); 726 spin_unlock(&gl->gl_spin);
730 up_read(&gfs2_umount_flush_sem);
731 if (!delay || 727 if (!delay ||
732 queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0) 728 queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0)
733 gfs2_glock_put(gl); 729 gfs2_glock_put(gl);
@@ -1512,35 +1508,10 @@ void gfs2_glock_thaw(struct gfs2_sbd *sdp)
1512 1508
1513void gfs2_gl_hash_clear(struct gfs2_sbd *sdp) 1509void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
1514{ 1510{
1515 unsigned long t;
1516 unsigned int x; 1511 unsigned int x;
1517 int cont;
1518 1512
1519 t = jiffies; 1513 for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
1520 1514 examine_bucket(clear_glock, sdp, x);
1521 for (;;) {
1522 cont = 0;
1523 for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
1524 if (examine_bucket(clear_glock, sdp, x))
1525 cont = 1;
1526 }
1527
1528 if (!cont)
1529 break;
1530
1531 if (time_after_eq(jiffies,
1532 t + gfs2_tune_get(sdp, gt_stall_secs) * HZ)) {
1533 fs_warn(sdp, "Unmount seems to be stalled. "
1534 "Dumping lock state...\n");
1535 gfs2_dump_lockstate(sdp);
1536 t = jiffies;
1537 }
1538
1539 down_write(&gfs2_umount_flush_sem);
1540 invalidate_inodes(sdp->sd_vfs);
1541 up_write(&gfs2_umount_flush_sem);
1542 msleep(10);
1543 }
1544 flush_workqueue(glock_workqueue); 1515 flush_workqueue(glock_workqueue);
1545 wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0); 1516 wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0);
1546 gfs2_dump_lockstate(sdp); 1517 gfs2_dump_lockstate(sdp);