aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/glock.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/glock.h')
-rw-r--r--fs/gfs2/glock.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/gfs2/glock.h b/fs/gfs2/glock.h
index b16f604eea9f..2f9c6d136b37 100644
--- a/fs/gfs2/glock.h
+++ b/fs/gfs2/glock.h
@@ -36,11 +36,13 @@ static inline int gfs2_glock_is_locked_by_me(struct gfs2_glock *gl)
36{ 36{
37 struct gfs2_holder *gh; 37 struct gfs2_holder *gh;
38 int locked = 0; 38 int locked = 0;
39 struct pid *pid;
39 40
40 /* Look in glock's list of holders for one with current task as owner */ 41 /* Look in glock's list of holders for one with current task as owner */
41 spin_lock(&gl->gl_spin); 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; 46 locked = 1;
45 break; 47 break;
46 } 48 }