diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 12:51:39 +0000 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 12:51:39 +0000 |
commit | f55ab26a8f92a23988c3e6da28dae4741933a4e2 (patch) | |
tree | b6f9e89ce1b2ccde8d81314aeea06f6a02f882f7 /fs/gfs2/quota.c | |
parent | 5c4e9e036678fae65c9288e1c00a6f33cd447283 (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/quota.c')
-rw-r--r-- | fs/gfs2/quota.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 7b5573946f1..c0352cf330a 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -251,10 +251,10 @@ static int bh_get(struct gfs2_quota_data *qd) struct buffer_head *bh; int error; - down(&sdp->sd_quota_mutex); + mutex_lock(&sdp->sd_quota_mutex); if (qd->qd_bh_count++) { - up(&sdp->sd_quota_mutex); + mutex_unlock(&sdp->sd_quota_mutex); return 0; } @@ -276,7 +276,7 @@ static int bh_get(struct gfs2_quota_data *qd) (bh->b_data + sizeof(struct gfs2_meta_header) + offset * sizeof(struct gfs2_quota_change)); - up(&sdp->sd_quota_mutex); + mutex_lock(&sdp->sd_quota_mutex); return 0; @@ -285,7 +285,7 @@ static int bh_get(struct gfs2_quota_data *qd) fail: qd->qd_bh_count--; - up(&sdp->sd_quota_mutex); + mutex_unlock(&sdp->sd_quota_mutex); return error; } @@ -293,14 +293,14 @@ static void bh_put(struct gfs2_quota_data *qd) { struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd; - down(&sdp->sd_quota_mutex); + mutex_lock(&sdp->sd_quota_mutex); gfs2_assert(sdp, qd->qd_bh_count); if (!--qd->qd_bh_count) { brelse(qd->qd_bh); qd->qd_bh = NULL; qd->qd_bh_qc = NULL; } - up(&sdp->sd_quota_mutex); + mutex_unlock(&sdp->sd_quota_mutex); } static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) @@ -529,7 +529,7 @@ static void do_qc(struct gfs2_quota_data *qd, int64_t change) struct gfs2_quota_change *qc = qd->qd_bh_qc; int64_t x; - down(&sdp->sd_quota_mutex); + mutex_lock(&sdp->sd_quota_mutex); gfs2_trans_add_bh(ip->i_gl, qd->qd_bh, 1); if (!test_bit(QDF_CHANGE, &qd->qd_flags)) { @@ -560,7 +560,7 @@ static void do_qc(struct gfs2_quota_data *qd, int64_t change) slot_hold(qd); } - up(&sdp->sd_quota_mutex); + mutex_unlock(&sdp->sd_quota_mutex); } /** |