aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-11-02 05:14:31 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-01-25 03:07:44 -0500
commite589665eb97b297412fb16b4c1737a01a91db903 (patch)
tree139a302a47bda6241d40a61bec1d7239de0e7108 /fs
parent3042a2ccd68d2b609d283219e51cba363aa35c1d (diff)
[GFS2] Remove flags no longer required
The HIF_MUTEX and HIF_PROMOTE flags were set on the glock holders depending upon which of the two waiters lists they were going to be queued upon. They were then tested when the holders were taken off the lists to ensure that the right type of holder was being dequeued. Since we are already using separate lists, there doesn't seem a lot of point having these flags as well, and since setting them and testing them is in the fast path for locking and unlocking glock, this patch removes them. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/glock.c17
-rw-r--r--fs/gfs2/incore.h4
2 files changed, 2 insertions, 19 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index e668808b127f..5fbd9d34ce23 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -594,12 +594,7 @@ static void run_queue(struct gfs2_glock *gl)
594 if (!list_empty(&gl->gl_waiters1)) { 594 if (!list_empty(&gl->gl_waiters1)) {
595 gh = list_entry(gl->gl_waiters1.next, 595 gh = list_entry(gl->gl_waiters1.next,
596 struct gfs2_holder, gh_list); 596 struct gfs2_holder, gh_list);
597 597 blocked = rq_mutex(gh);
598 if (test_bit(HIF_MUTEX, &gh->gh_iflags))
599 blocked = rq_mutex(gh);
600 else
601 gfs2_assert_warn(gl->gl_sbd, 0);
602
603 } else if (test_bit(GLF_DEMOTE, &gl->gl_flags)) { 598 } else if (test_bit(GLF_DEMOTE, &gl->gl_flags)) {
604 blocked = rq_demote(gl); 599 blocked = rq_demote(gl);
605 if (gl->gl_waiters2 && !blocked) { 600 if (gl->gl_waiters2 && !blocked) {
@@ -610,12 +605,7 @@ static void run_queue(struct gfs2_glock *gl)
610 } else if (!list_empty(&gl->gl_waiters3)) { 605 } else if (!list_empty(&gl->gl_waiters3)) {
611 gh = list_entry(gl->gl_waiters3.next, 606 gh = list_entry(gl->gl_waiters3.next,
612 struct gfs2_holder, gh_list); 607 struct gfs2_holder, gh_list);
613 608 blocked = rq_promote(gh);
614 if (test_bit(HIF_PROMOTE, &gh->gh_iflags))
615 blocked = rq_promote(gh);
616 else
617 gfs2_assert_warn(gl->gl_sbd, 0);
618
619 } else 609 } else
620 break; 610 break;
621 611
@@ -636,7 +626,6 @@ static void gfs2_glmutex_lock(struct gfs2_glock *gl)
636 struct gfs2_holder gh; 626 struct gfs2_holder gh;
637 627
638 gfs2_holder_init(gl, 0, 0, &gh); 628 gfs2_holder_init(gl, 0, 0, &gh);
639 set_bit(HIF_MUTEX, &gh.gh_iflags);
640 if (test_and_set_bit(HIF_WAIT, &gh.gh_iflags)) 629 if (test_and_set_bit(HIF_WAIT, &gh.gh_iflags))
641 BUG(); 630 BUG();
642 631
@@ -1160,8 +1149,6 @@ restart:
1160 return -EIO; 1149 return -EIO;
1161 } 1150 }
1162 1151
1163 set_bit(HIF_PROMOTE, &gh->gh_iflags);
1164
1165 spin_lock(&gl->gl_spin); 1152 spin_lock(&gl->gl_spin);
1166 add_to_queue(gh); 1153 add_to_queue(gh);
1167 run_queue(gl); 1154 run_queue(gl);
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index 089dba412cc0..478023e9fda6 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -141,10 +141,6 @@ struct gfs2_glock_operations {
141}; 141};
142 142
143enum { 143enum {
144 /* Actions */
145 HIF_MUTEX = 0,
146 HIF_PROMOTE = 1,
147
148 /* States */ 144 /* States */
149 HIF_HOLDER = 6, 145 HIF_HOLDER = 6,
150 HIF_FIRST = 7, 146 HIF_FIRST = 7,