GFS2: glock livelock
[safe/jmp/linux-2.6] / fs / gfs2 / glock.h
index c609894..2bda191 100644 (file)
@@ -123,7 +123,7 @@ struct lm_lockops {
        int (*lm_mount) (struct gfs2_sbd *sdp, const char *fsname);
        void (*lm_unmount) (struct gfs2_sbd *sdp);
        void (*lm_withdraw) (struct gfs2_sbd *sdp);
-       void (*lm_put_lock) (struct kmem_cache *cachep, void *gl);
+       void (*lm_put_lock) (struct kmem_cache *cachep, struct gfs2_glock *gl);
        unsigned int (*lm_lock) (struct gfs2_glock *gl,
                                 unsigned int req_state, unsigned int flags);
        void (*lm_cancel) (struct gfs2_glock *gl);
@@ -180,13 +180,11 @@ static inline int gfs2_glock_is_held_shrd(struct gfs2_glock *gl)
        return gl->gl_state == LM_ST_SHARED;
 }
 
-static inline int gfs2_glock_is_blocking(struct gfs2_glock *gl)
+static inline struct address_space *gfs2_glock2aspace(struct gfs2_glock *gl)
 {
-       int ret;
-       spin_lock(&gl->gl_spin);
-       ret = test_bit(GLF_DEMOTE, &gl->gl_flags);
-       spin_unlock(&gl->gl_spin);
-       return ret;
+       if (gl->gl_ops->go_flags & GLOF_ASPACE)
+               return (struct address_space *)(gl + 1);
+       return NULL;
 }
 
 int gfs2_glock_get(struct gfs2_sbd *sdp,