From f55ab26a8f92a23988c3e6da28dae4741933a4e2 Mon Sep 17 00:00:00 2001 From: Steven Whitehouse Date: Tue, 21 Feb 2006 12:51:39 +0000 Subject: [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 --- fs/gfs2/super.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'fs/gfs2/super.c') diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9b5c31952c5..be80771c414 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) name.name = buf; - down(&sdp->sd_jindex_mutex); + mutex_lock(&sdp->sd_jindex_mutex); for (;;) { 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) spin_unlock(&sdp->sd_jindex_spin); } - up(&sdp->sd_jindex_mutex); + mutex_unlock(&sdp->sd_jindex_mutex); return error; } @@ -608,9 +608,9 @@ void gfs2_statfs_change(struct gfs2_sbd *sdp, int64_t total, int64_t free, if (error) return; - down(&sdp->sd_statfs_mutex); + mutex_lock(&sdp->sd_statfs_mutex); gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); - up(&sdp->sd_statfs_mutex); + mutex_unlock(&sdp->sd_statfs_mutex); spin_lock(&sdp->sd_statfs_spin); l_sc->sc_total += total; @@ -659,9 +659,9 @@ int gfs2_statfs_sync(struct gfs2_sbd *sdp) if (error) goto out_bh2; - down(&sdp->sd_statfs_mutex); + mutex_lock(&sdp->sd_statfs_mutex); gfs2_trans_add_bh(l_ip->i_gl, l_bh, 1); - up(&sdp->sd_statfs_mutex); + mutex_unlock(&sdp->sd_statfs_mutex); spin_lock(&sdp->sd_statfs_spin); m_sc->sc_total += l_sc->sc_total; @@ -910,7 +910,7 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp) { int error = 0; - down(&sdp->sd_freeze_lock); + mutex_lock(&sdp->sd_freeze_lock); if (!sdp->sd_freeze_count++) { error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh); @@ -918,7 +918,7 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp) sdp->sd_freeze_count--; } - up(&sdp->sd_freeze_lock); + mutex_unlock(&sdp->sd_freeze_lock); return error; } @@ -935,11 +935,11 @@ int gfs2_freeze_fs(struct gfs2_sbd *sdp) void gfs2_unfreeze_fs(struct gfs2_sbd *sdp) { - down(&sdp->sd_freeze_lock); + mutex_lock(&sdp->sd_freeze_lock); if (sdp->sd_freeze_count && !--sdp->sd_freeze_count) gfs2_glock_dq_uninit(&sdp->sd_freeze_gh); - up(&sdp->sd_freeze_lock); + mutex_unlock(&sdp->sd_freeze_lock); } -- cgit v1.2.3