diff options
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/glock.c | 7 | ||||
-rw-r--r-- | fs/gfs2/incore.h | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index befcda0e53a1..951cb91e7ddb 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -595,11 +595,12 @@ static void run_queue(struct gfs2_glock *gl) | |||
595 | blocked = rq_mutex(gh); | 595 | blocked = rq_mutex(gh); |
596 | } else if (test_bit(GLF_DEMOTE, &gl->gl_flags)) { | 596 | } else if (test_bit(GLF_DEMOTE, &gl->gl_flags)) { |
597 | blocked = rq_demote(gl); | 597 | blocked = rq_demote(gl); |
598 | if (gl->gl_waiters2 && !blocked) { | 598 | if (test_bit(GLF_WAITERS2, &gl->gl_flags) && |
599 | !blocked) { | ||
599 | set_bit(GLF_DEMOTE, &gl->gl_flags); | 600 | set_bit(GLF_DEMOTE, &gl->gl_flags); |
600 | gl->gl_demote_state = LM_ST_UNLOCKED; | 601 | gl->gl_demote_state = LM_ST_UNLOCKED; |
601 | } | 602 | } |
602 | gl->gl_waiters2 = 0; | 603 | clear_bit(GLF_WAITERS2, &gl->gl_flags); |
603 | } else if (!list_empty(&gl->gl_waiters3)) { | 604 | } else if (!list_empty(&gl->gl_waiters3)) { |
604 | gh = list_entry(gl->gl_waiters3.next, | 605 | gh = list_entry(gl->gl_waiters3.next, |
605 | struct gfs2_holder, gh_list); | 606 | struct gfs2_holder, gh_list); |
@@ -710,7 +711,7 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state, | |||
710 | } else if (gl->gl_demote_state != LM_ST_UNLOCKED && | 711 | } else if (gl->gl_demote_state != LM_ST_UNLOCKED && |
711 | gl->gl_demote_state != state) { | 712 | gl->gl_demote_state != state) { |
712 | if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) | 713 | if (test_bit(GLF_DEMOTE_IN_PROGRESS, &gl->gl_flags)) |
713 | gl->gl_waiters2 = 1; | 714 | set_bit(GLF_WAITERS2, &gl->gl_flags); |
714 | else | 715 | else |
715 | gl->gl_demote_state = LM_ST_UNLOCKED; | 716 | gl->gl_demote_state = LM_ST_UNLOCKED; |
716 | } | 717 | } |
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 39bab7b213e9..fe14f6a417b5 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
3 | * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. | 3 | * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This copyrighted material is made available to anyone wishing to use, | 5 | * This copyrighted material is made available to anyone wishing to use, |
6 | * modify, copy, or redistribute it subject to the terms and conditions | 6 | * modify, copy, or redistribute it subject to the terms and conditions |
@@ -167,6 +167,7 @@ enum { | |||
167 | GLF_DIRTY = 5, | 167 | GLF_DIRTY = 5, |
168 | GLF_DEMOTE_IN_PROGRESS = 6, | 168 | GLF_DEMOTE_IN_PROGRESS = 6, |
169 | GLF_LFLUSH = 7, | 169 | GLF_LFLUSH = 7, |
170 | GLF_WAITERS2 = 8, | ||
170 | }; | 171 | }; |
171 | 172 | ||
172 | struct gfs2_glock { | 173 | struct gfs2_glock { |
@@ -186,7 +187,6 @@ struct gfs2_glock { | |||
186 | struct list_head gl_holders; | 187 | struct list_head gl_holders; |
187 | struct list_head gl_waiters1; /* HIF_MUTEX */ | 188 | struct list_head gl_waiters1; /* HIF_MUTEX */ |
188 | struct list_head gl_waiters3; /* HIF_PROMOTE */ | 189 | struct list_head gl_waiters3; /* HIF_PROMOTE */ |
189 | int gl_waiters2; /* GIF_DEMOTE */ | ||
190 | 190 | ||
191 | const struct gfs2_glock_operations *gl_ops; | 191 | const struct gfs2_glock_operations *gl_ops; |
192 | 192 | ||