]> err.no Git - linux-2.6/blobdiff - fs/gfs2/glock.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / fs / gfs2 / glock.c
index 2316490723c04596f21c47e18c830c52b04951b5..78fe0fae23ff538d26af8f3d15a877dd61368e72 100644 (file)
 #include <linux/kallsyms.h>
 #include <linux/gfs2_ondisk.h>
 #include <linux/list.h>
+#include <linux/lm_interface.h>
 #include <asm/uaccess.h>
 
 #include "gfs2.h"
-#include "lm_interface.h"
 #include "incore.h"
 #include "glock.h"
 #include "glops.h"
@@ -371,7 +371,7 @@ fail_aspace:
        if (gl->gl_aspace)
                gfs2_aspace_put(gl->gl_aspace);
 fail:
-       kmem_cache_free(gfs2_glock_cachep, gl); 
+       kmem_cache_free(gfs2_glock_cachep, gl);
        return error;
 }
 
@@ -614,7 +614,7 @@ static int rq_greedy(struct gfs2_holder *gh)
        gfs2_holder_uninit(gh);
        kfree(container_of(gh, struct greedy, gr_gh));
 
-       spin_lock(&gl->gl_spin);                
+       spin_lock(&gl->gl_spin);
 
        return 0;
 }
@@ -1184,11 +1184,11 @@ static void add_to_queue(struct gfs2_holder *gh)
        if (existing) {
                print_symbol(KERN_WARNING "original: %s\n", existing->gh_ip);
                printk(KERN_INFO "pid : %d\n", existing->gh_owner->pid);
-               printk(KERN_INFO "lock type : %d lock state : %d\n", 
+               printk(KERN_INFO "lock type : %d lock state : %d\n",
                                existing->gh_gl->gl_name.ln_type, existing->gh_gl->gl_state);
                print_symbol(KERN_WARNING "new: %s\n", gh->gh_ip);
                printk(KERN_INFO "pid : %d\n", gh->gh_owner->pid);
-               printk(KERN_INFO "lock type : %d lock state : %d\n", 
+               printk(KERN_INFO "lock type : %d lock state : %d\n",
                                gl->gl_name.ln_type, gl->gl_state);
                BUG();
        }
@@ -1203,7 +1203,7 @@ static void add_to_queue(struct gfs2_holder *gh)
        if (gh->gh_flags & LM_FLAG_PRIORITY)
                list_add(&gh->gh_list, &gl->gl_waiters3);
        else
-               list_add_tail(&gh->gh_list, &gl->gl_waiters3);  
+               list_add_tail(&gh->gh_list, &gl->gl_waiters3);
 }
 
 /**
@@ -1892,7 +1892,6 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,
        /* Can't use hlist_for_each_entry - don't want prefetch here */
        if (hlist_empty(head))
                goto out;
-       has_entries = 1;
        gl = list_entry(head->first, struct gfs2_glock, gl_list);
        while(1) {
                if (gl->gl_sbd == sdp) {
@@ -1902,6 +1901,7 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp,
                                gfs2_glock_put(prev);
                        prev = gl;
                        examiner(gl);
+                       has_entries = 1;
                        read_lock(gl_lock_addr(hash));
                }
                if (gl->gl_list.next == NULL)
@@ -2003,7 +2003,7 @@ void gfs2_gl_hash_clear(struct gfs2_sbd *sdp, int wait)
        for (;;) {
                cont = 0;
                for (x = 0; x < GFS2_GL_HASH_SIZE; x++) {
-                       if (examine_bucket(clear_glock, sdp, x)) 
+                       if (examine_bucket(clear_glock, sdp, x))
                                cont = 1;
                }