diff options
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 33 |
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) |
61 | static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target); | 60 | static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target); |
62 | 61 | ||
63 | static DECLARE_RWSEM(gfs2_umount_flush_sem); | ||
64 | static struct dentry *gfs2_root; | 62 | static struct dentry *gfs2_root; |
65 | static struct workqueue_struct *glock_workqueue; | 63 | static struct workqueue_struct *glock_workqueue; |
66 | struct workqueue_struct *gfs2_delete_workqueue; | 64 | struct 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 | ||
1513 | void gfs2_gl_hash_clear(struct gfs2_sbd *sdp) | 1509 | void 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); |