glock.h (ebf8889bd1fe3615991ff4494635d237280652a2) glock.h (b1e058da50f7938e9c9e963e978b0730bba4ad32)
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 22 unchanged lines hidden (view full) ---

31
32#define GLR_TRYFAILED 13
33#define GLR_CANCELED 14
34
35static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
36{
37 struct gfs2_holder *gh;
38 int locked = 0;
1/*
2 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
4 *
5 * This copyrighted material is made available to anyone wishing to use,
6 * modify, copy, or redistribute it subject to the terms and conditions
7 * of the GNU General Public License version 2.
8 */

--- 22 unchanged lines hidden (view full) ---

31
32#define GLR_TRYFAILED 13
33#define GLR_CANCELED 14
34
35static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
36{
37 struct gfs2_holder *gh;
38 int locked = 0;
39 struct pid *pid;
39
40 /* Look in glock's list of holders for one with current task as owner */
41 spin_lock(&gl->gl_spin);
40
41 /* Look in glock's list of holders for one with current task as owner */
42 spin_lock(&gl->gl_spin);
43 pid = task_pid(current);
42 list_for_each_entry(gh, &gl->gl_holders, gh_list) {
44 list_for_each_entry(gh, &gl->gl_holders, gh_list) {
43 if (gh->gh_owner_pid == current->pid) {
45 if (gh->gh_owner_pid == pid) {
44 locked = 1;
45 break;
46 }
47 }
48 spin_unlock(&gl->gl_spin);
49
50 return locked;
51}

--- 95 unchanged lines hidden ---
46 locked = 1;
47 break;
48 }
49 }
50 spin_unlock(&gl->gl_spin);
51
52 return locked;
53}

--- 95 unchanged lines hidden ---