]> err.no Git - linux-2.6/blobdiff - fs/gfs2/glock.c
Char: icom, mark __init as __devinit
[linux-2.6] / fs / gfs2 / glock.c
index f68582ddaa5c1e4a19cc34322c538b634a953b63..12accb08fe02d3e701fa49e79d9e1a1c7519f495 100644 (file)
@@ -20,6 +20,8 @@
 #include <linux/list.h>
 #include <linux/lm_interface.h>
 #include <linux/wait.h>
+#include <linux/module.h>
+#include <linux/rwsem.h>
 #include <asm/uaccess.h>
 
 #include "gfs2.h"
@@ -45,6 +47,7 @@ static int dump_glock(struct gfs2_glock *gl);
 static int dump_inode(struct gfs2_inode *ip);
 static void gfs2_glock_xmote_th(struct gfs2_holder *gh);
 static void gfs2_glock_drop_th(struct gfs2_glock *gl);
+static DECLARE_RWSEM(gfs2_umount_flush_sem);
 
 #define GFS2_GL_HASH_SHIFT      15
 #define GFS2_GL_HASH_SIZE       (1 << GFS2_GL_HASH_SHIFT)
@@ -482,7 +485,7 @@ static int rq_mutex(struct gfs2_holder *gh)
        list_del_init(&gh->gh_list);
        /*  gh->gh_error never examined.  */
        set_bit(GLF_LOCK, &gl->gl_flags);
-       clear_bit(HIF_WAIT, &gh->gh_flags);
+       clear_bit(HIF_WAIT, &gh->gh_iflags);
        smp_mb();
        wake_up_bit(&gh->gh_iflags, HIF_WAIT);
 
@@ -951,9 +954,6 @@ static void drop_bh(struct gfs2_glock *gl, unsigned int ret)
                spin_unlock(&gl->gl_spin);
        }
 
-       if (glops->go_drop_bh)
-               glops->go_drop_bh(gl);
-
        spin_lock(&gl->gl_spin);
        gl->gl_req_gh = NULL;
        gl->gl_req_bh = NULL;
@@ -1578,12 +1578,14 @@ void gfs2_glock_cb(void *cb_data, unsigned int type, void *data)
                struct lm_async_cb *async = data;
                struct gfs2_glock *gl;
 
+               down_read(&gfs2_umount_flush_sem);
                gl = gfs2_glock_find(sdp, &async->lc_name);
                if (gfs2_assert_warn(sdp, gl))
                        return;
                if (!gfs2_assert_warn(sdp, gl->gl_req_bh))
                        gl->gl_req_bh(gl, async->lc_ret);
                gfs2_glock_put(gl);
+               up_read(&gfs2_umount_flush_sem);
                return;
        }
 
@@ -1828,7 +1830,9 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
                        t = jiffies;
                }
 
+               down_write(&gfs2_umount_flush_sem);
                invalidate_inodes(sdp->sd_vfs);
+               up_write(&gfs2_umount_flush_sem);
                msleep(10);
        }
 }