]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
GFS2: Remove loopy umount code
authorSteven Whitehouse <swhiteho@redhat.com>
Fri, 8 Jan 2010 16:14:29 +0000 (16:14 +0000)
committerSteven Whitehouse <swhiteho@redhat.com>
Mon, 1 Mar 2010 14:07:53 +0000 (14:07 +0000)
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>
fs/gfs2/glock.c
fs/gfs2/incore.h
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/gfs2/sys.c

index dfb10a4d467e34d5a70bfef124b48420e6a05eec..4773f9098a41dfcb0c43ca4777d4b1d40471c364 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/module.h>
-#include <linux/rwsem.h>
 #include <asm/uaccess.h>
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
@@ -60,7 +59,6 @@ static int __dump_glock(struct seq_file *seq, const struct gfs2_glock *gl);
 #define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { __dump_glock(NULL, gl); BUG(); } } while(0)
 static void do_xmote(struct gfs2_glock *gl, struct gfs2_holder *gh, unsigned int target);
 
-static DECLARE_RWSEM(gfs2_umount_flush_sem);
 static struct dentry *gfs2_root;
 static struct workqueue_struct *glock_workqueue;
 struct workqueue_struct *gfs2_delete_workqueue;
@@ -714,7 +712,6 @@ static void glock_work_func(struct work_struct *work)
                finish_xmote(gl, gl->gl_reply);
                drop_ref = 1;
        }
-       down_read(&gfs2_umount_flush_sem);
        spin_lock(&gl->gl_spin);
        if (test_and_clear_bit(GLF_PENDING_DEMOTE, &gl->gl_flags) &&
            gl->gl_state != LM_ST_UNLOCKED &&
@@ -727,7 +724,6 @@ static void glock_work_func(struct work_struct *work)
        }
        run_queue(gl, 0);
        spin_unlock(&gl->gl_spin);
-       up_read(&gfs2_umount_flush_sem);
        if (!delay ||
            queue_delayed_work(glock_workqueue, &gl->gl_work, delay) == 0)
                gfs2_glock_put(gl);
@@ -1512,35 +1508,10 @@ void gfs2_glock_thaw(struct gfs2_sbd *sdp)
 
 void gfs2_gl_hash_clear(struct gfs2_sbd *sdp)
 {
-       unsigned long t;
        unsigned int x;
-       int cont;
 
-       t = jiffies;
-
-       for (;;) {
-               cont = 0;
-               for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
-                       if (examine_bucket(clear_glock, sdp, x))
-                               cont = 1;
-               }
-
-               if (!cont)
-                       break;
-
-               if (time_after_eq(jiffies,
-                                 t + gfs2_tune_get(sdp, gt_stall_secs) * HZ)) {
-                       fs_warn(sdp, "Unmount seems to be stalled. "
-                                    "Dumping lock state...\n");
-                       gfs2_dump_lockstate(sdp);
-                       t = jiffies;
-               }
-
-               down_write(&gfs2_umount_flush_sem);
-               invalidate_inodes(sdp->sd_vfs);
-               up_write(&gfs2_umount_flush_sem);
-               msleep(10);
-       }
+       for (x = 0; x < GFS2_GL_HASH_SIZE; x++)
+               examine_bucket(clear_glock, sdp, x);
        flush_workqueue(glock_workqueue);
        wait_event(sdp->sd_glock_wait, atomic_read(&sdp->sd_glock_disposal) == 0);
        gfs2_dump_lockstate(sdp);
index 1de7e1b7ce83919cb7e36cb7d0a4107da64c9eb5..b8025e51cabfb167de7e3e1413329759da8a85a0 100644 (file)
@@ -451,7 +451,6 @@ struct gfs2_tune {
        unsigned int gt_quota_quantum; /* Secs between syncs to quota file */
        unsigned int gt_new_files_jdata;
        unsigned int gt_max_readahead; /* Max bytes to read-ahead from disk */
-       unsigned int gt_stall_secs; /* Detects trouble! */
        unsigned int gt_complain_secs;
        unsigned int gt_statfs_quantum;
        unsigned int gt_statfs_slow;
index a86ed63815667f456a88e24cad30e3a60bb67e34..a054b526dc085278e9d237653b03948654d60fa9 100644 (file)
@@ -65,7 +65,6 @@ static void gfs2_tune_init(struct gfs2_tune *gt)
        gt->gt_quota_scale_den = 1;
        gt->gt_new_files_jdata = 0;
        gt->gt_max_readahead = 1 << 18;
-       gt->gt_stall_secs = 600;
        gt->gt_complain_secs = 10;
 }
 
@@ -1241,10 +1240,9 @@ fail_sb:
 fail_locking:
        init_locking(sdp, &mount_gh, UNDO);
 fail_lm:
+       invalidate_inodes(sb);
        gfs2_gl_hash_clear(sdp);
        gfs2_lm_unmount(sdp);
-       while (invalidate_inodes(sb))
-               yield();
 fail_sys:
        gfs2_sys_fs_del(sdp);
 fail:
index ad7bc2d25ac27fad30584a1b2ccf7e3ee5429a5c..e5e22629da67cd5aa1a987ca76a92f18037fd694 100644 (file)
@@ -859,6 +859,7 @@ restart:
        gfs2_clear_rgrpd(sdp);
        gfs2_jindex_free(sdp);
        /*  Take apart glock structures and buffer lists  */
+       invalidate_inodes(sdp->sd_vfs);
        gfs2_gl_hash_clear(sdp);
        /*  Unmount the locking protocol  */
        gfs2_lm_unmount(sdp);
index 0dc34621f6a6ecf73acddc3c82d0a90c731ff601..a0db1c94317dd5b72e0f3c3a95f82d1126d8f4e9 100644 (file)
@@ -478,7 +478,6 @@ TUNE_ATTR(complain_secs, 0);
 TUNE_ATTR(statfs_slow, 0);
 TUNE_ATTR(new_files_jdata, 0);
 TUNE_ATTR(quota_simul_sync, 1);
-TUNE_ATTR(stall_secs, 1);
 TUNE_ATTR(statfs_quantum, 1);
 TUNE_ATTR_3(quota_scale, quota_scale_show, quota_scale_store);
 
@@ -491,7 +490,6 @@ static struct attribute *tune_attrs[] = {
        &tune_attr_complain_secs.attr,
        &tune_attr_statfs_slow.attr,
        &tune_attr_quota_simul_sync.attr,
-       &tune_attr_stall_secs.attr,
        &tune_attr_statfs_quantum.attr,
        &tune_attr_quota_scale.attr,
        &tune_attr_new_files_jdata.attr,