]> err.no Git - linux-2.6/blobdiff - fs/gfs2/glock.h
Merge branch 'powerpc-next' of master.kernel.org:/pub/scm/linux/kernel/git/galak...
[linux-2.6] / fs / gfs2 / glock.h
index ace5770760ce26f2e637006e63c2ebb2a1179947..cdad3e6f815026dfc55d542d1fc84c4b8f778984 100644 (file)
 #define GLR_TRYFAILED          13
 #define GLR_CANCELED           14
 
-static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
+static inline struct gfs2_holder *gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
 {
        struct gfs2_holder *gh;
-       int locked = 0;
        struct pid *pid;
 
        /* Look in glock's list of holders for one with current task as owner */
        spin_lock(&gl->gl_spin);
        pid = task_pid(current);
        list_for_each_entry(gh, &gl->gl_holders, gh_list) {
-               if (gh->gh_owner_pid == pid) {
-                       locked = 1;
-                       break;
-               }
+               if (gh->gh_owner_pid == pid)
+                       goto out;
        }
+       gh = NULL;
+out:
        spin_unlock(&gl->gl_spin);
 
-       return locked;
+       return gh;
 }
 
 static inline int gfs2_glock_is_held_excl(struct gfs2_glock *gl)