Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76048
b: refs/heads/master
c: 398bbe6
h: refs/heads/master
v: v3
  • Loading branch information
Bob Peterson authored and Steven Whitehouse committed Jan 25, 2008
1 parent 7adcd5b commit f7df6dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5fdc2eeb5d1d3800367f471690b01fcd1fd5b963
refs/heads/master: 398bbe68321947f6763fbc259a01eb548ce19408
23 changes: 9 additions & 14 deletions trunk/fs/gfs2/glock.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
Expand Down Expand Up @@ -620,26 +620,21 @@ static void run_queue(struct gfs2_glock *gl)

static void gfs2_glmutex_lock(struct gfs2_glock *gl)
{
struct gfs2_holder gh;

gfs2_holder_init(gl, 0, 0, &gh);
if (test_and_set_bit(HIF_WAIT, &gh.gh_iflags))
BUG();

spin_lock(&gl->gl_spin);
if (test_and_set_bit(GLF_LOCK, &gl->gl_flags)) {
struct gfs2_holder gh;

gfs2_holder_init(gl, 0, 0, &gh);
set_bit(HIF_WAIT, &gh.gh_iflags);
list_add_tail(&gh.gh_list, &gl->gl_waiters1);
spin_unlock(&gl->gl_spin);
wait_on_holder(&gh);
gfs2_holder_uninit(&gh);
} else {
gl->gl_owner_pid = current->pid;
gl->gl_ip = (unsigned long)__builtin_return_address(0);
clear_bit(HIF_WAIT, &gh.gh_iflags);
smp_mb();
wake_up_bit(&gh.gh_iflags, HIF_WAIT);
spin_unlock(&gl->gl_spin);
}
spin_unlock(&gl->gl_spin);

wait_on_holder(&gh);
gfs2_holder_uninit(&gh);
}

/**
Expand Down

0 comments on commit f7df6dd

Please sign in to comment.