aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/super.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-02-21 07:51:39 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-02-21 07:51:39 -0500
commitf55ab26a8f92a23988c3e6da28dae4741933a4e2 (patch)
treeb6f9e89ce1b2ccde8d81314aeea06f6a02f882f7 /fs/gfs2/super.c
parent5c4e9e036678fae65c9288e1c00a6f33cd447283 (diff)
[GFS2] Use mutices rather than semaphores
As well as a number of minor bug fixes, this patch changes GFS to use mutices rather than semaphores. This results in better information in case there are any locking problems. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r--fs/gfs2/super.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 9b5c31952c5d..be80771c414d 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -279,7 +279,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
279 279
280 name.name = buf; 280 name.name = buf;
281 281
282 down(&sdp->sd_jindex_mutex); 282 mutex_lock(&sdp->sd_jindex_mutex);
283 283
284 for (;;) { 284 for (;;) {
285 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 285 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED,
@@ -317,7 +317,7 @@ int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
317 spin_unlock(&sdp->sd_jindex_spin); 317 spin_unlock(&sdp->sd_jindex_spin);
318 } 318 }
319 319
320 up(&sdp->sd_jindex_mutex); 320 mutex_unlock(&sdp->sd_jindex_mutex);
321 321
322 return error; 322 return error;
323} 323}
@@ -608,9 +608,9 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, int64_t total, int64_t free,
608 if (error) 608 if (error)
609 return; 609 return;
610 610
611 down(&sdp->sd_statfs_mutex); 611 mutex_lock(&sdp->sd_statfs_mutex);
612 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); 612 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
613 up(&sdp->sd_statfs_mutex); 613 mutex_unlock(&sdp->sd_statfs_mutex);
614 614
615 spin_lock(&sdp->sd_statfs_spin); 615 spin_lock(&sdp->sd_statfs_spin);
616 l_sc->sc_total += total; 616 l_sc->sc_total += total;
@@ -659,9 +659,9 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp)
659 if (error) 659 if (error)
660 goto out_bh2; 660 goto out_bh2;
661 661
662 down(&sdp->sd_statfs_mutex); 662 mutex_lock(&sdp->sd_statfs_mutex);
663 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); 663 gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1);
664 up(&sdp->sd_statfs_mutex); 664 mutex_unlock(&sdp->sd_statfs_mutex);
665 665
666 spin_lock(&sdp->sd_statfs_spin); 666 spin_lock(&sdp->sd_statfs_spin);
667 m_sc->sc_total += l_sc->sc_total; 667 m_sc->sc_total += l_sc->sc_total;
@@ -910,7 +910,7 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp)
910{ 910{
911 int error = 0; 911 int error = 0;
912 912
913 down(&sdp->sd_freeze_lock); 913 mutex_lock(&sdp->sd_freeze_lock);
914 914
915 if (!sdp->sd_freeze_count++) { 915 if (!sdp->sd_freeze_count++) {
916 error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh); 916 error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh);
@@ -918,7 +918,7 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp)
918 sdp->sd_freeze_count--; 918 sdp->sd_freeze_count--;
919 } 919 }
920 920
921 up(&sdp->sd_freeze_lock); 921 mutex_unlock(&sdp->sd_freeze_lock);
922 922
923 return error; 923 return error;
924} 924}
@@ -935,11 +935,11 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp)
935 935
936void gfs2_unfreeze_fs(struct gfs2_sbd *sdp) 936void gfs2_unfreeze_fs(struct gfs2_sbd *sdp)
937{ 937{
938 down(&sdp->sd_freeze_lock); 938 mutex_lock(&sdp->sd_freeze_lock);
939 939
940 if (sdp->sd_freeze_count && !--sdp->sd_freeze_count) 940 if (sdp->sd_freeze_count && !--sdp->sd_freeze_count)
941 gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); 941 gfs2_glock_dq_uninit(&sdp->sd_freeze_gh);
942 942
943 up(&sdp->sd_freeze_lock); 943 mutex_unlock(&sdp->sd_freeze_lock);
944} 944}
945 945