diff options
author | Bob Peterson <rpeterso@redhat.com> | 2008-01-28 23:31:39 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-03-31 05:40:13 -0400 |
commit | 29d38cd16358dcaef4a6c50866ecee28025b481a (patch) | |
tree | e8694d79f6c422aa68af5c493f8b761c7eff5515 /fs/gfs2/glock.c | |
parent | 42d52e3818751633656fb90df1bd5cb5362fa8cc (diff) |
[GFS2] Get rid of gl_waiters2
This patch reduces memory by replacing the int variable
gl_waiters2 by a single bit in the gl_flags.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 7 |
1 files changed, 4 insertions, 3 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 | } |