diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 07:51:39 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-02-21 07:51:39 -0500 |
commit | f55ab26a8f92a23988c3e6da28dae4741933a4e2 (patch) | |
tree | b6f9e89ce1b2ccde8d81314aeea06f6a02f882f7 /fs/gfs2/rgrp.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/rgrp.c')
-rw-r--r-- | fs/gfs2/rgrp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 758cc565813a..2e69e5cda967 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -182,9 +182,9 @@ static void clear_rgrpdi(struct gfs2_sbd *sdp) | |||
182 | 182 | ||
183 | void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) | 183 | void gfs2_clear_rgrpd(struct gfs2_sbd *sdp) |
184 | { | 184 | { |
185 | down(&sdp->sd_rindex_mutex); | 185 | mutex_lock(&sdp->sd_rindex_mutex); |
186 | clear_rgrpdi(sdp); | 186 | clear_rgrpdi(sdp); |
187 | up(&sdp->sd_rindex_mutex); | 187 | mutex_unlock(&sdp->sd_rindex_mutex); |
188 | } | 188 | } |
189 | 189 | ||
190 | /** | 190 | /** |
@@ -301,7 +301,7 @@ static int gfs2_ri_update(struct gfs2_inode *ip) | |||
301 | if (!rgd) | 301 | if (!rgd) |
302 | goto fail; | 302 | goto fail; |
303 | 303 | ||
304 | init_MUTEX(&rgd->rd_mutex); | 304 | mutex_init(&rgd->rd_mutex); |
305 | lops_init_le(&rgd->rd_le, &gfs2_rg_lops); | 305 | lops_init_le(&rgd->rd_le, &gfs2_rg_lops); |
306 | rgd->rd_sbd = sdp; | 306 | rgd->rd_sbd = sdp; |
307 | 307 | ||
@@ -363,13 +363,13 @@ int gfs2_rindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ri_gh) | |||
363 | 363 | ||
364 | /* Read new copy from disk if we don't have the latest */ | 364 | /* Read new copy from disk if we don't have the latest */ |
365 | if (sdp->sd_rindex_vn != gl->gl_vn) { | 365 | if (sdp->sd_rindex_vn != gl->gl_vn) { |
366 | down(&sdp->sd_rindex_mutex); | 366 | mutex_lock(&sdp->sd_rindex_mutex); |
367 | if (sdp->sd_rindex_vn != gl->gl_vn) { | 367 | if (sdp->sd_rindex_vn != gl->gl_vn) { |
368 | error = gfs2_ri_update(ip); | 368 | error = gfs2_ri_update(ip); |
369 | if (error) | 369 | if (error) |
370 | gfs2_glock_dq_uninit(ri_gh); | 370 | gfs2_glock_dq_uninit(ri_gh); |
371 | } | 371 | } |
372 | up(&sdp->sd_rindex_mutex); | 372 | mutex_unlock(&sdp->sd_rindex_mutex); |
373 | } | 373 | } |
374 | 374 | ||
375 | return error; | 375 | return error; |
@@ -394,13 +394,13 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd) | |||
394 | unsigned int x, y; | 394 | unsigned int x, y; |
395 | int error; | 395 | int error; |
396 | 396 | ||
397 | down(&rgd->rd_mutex); | 397 | mutex_lock(&rgd->rd_mutex); |
398 | 398 | ||
399 | spin_lock(&sdp->sd_rindex_spin); | 399 | spin_lock(&sdp->sd_rindex_spin); |
400 | if (rgd->rd_bh_count) { | 400 | if (rgd->rd_bh_count) { |
401 | rgd->rd_bh_count++; | 401 | rgd->rd_bh_count++; |
402 | spin_unlock(&sdp->sd_rindex_spin); | 402 | spin_unlock(&sdp->sd_rindex_spin); |
403 | up(&rgd->rd_mutex); | 403 | mutex_unlock(&rgd->rd_mutex); |
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
406 | spin_unlock(&sdp->sd_rindex_spin); | 406 | spin_unlock(&sdp->sd_rindex_spin); |
@@ -436,7 +436,7 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd) | |||
436 | rgd->rd_bh_count++; | 436 | rgd->rd_bh_count++; |
437 | spin_unlock(&sdp->sd_rindex_spin); | 437 | spin_unlock(&sdp->sd_rindex_spin); |
438 | 438 | ||
439 | up(&rgd->rd_mutex); | 439 | mutex_unlock(&rgd->rd_mutex); |
440 | 440 | ||
441 | return 0; | 441 | return 0; |
442 | 442 | ||
@@ -447,7 +447,7 @@ int gfs2_rgrp_bh_get(struct gfs2_rgrpd *rgd) | |||
447 | bi->bi_bh = NULL; | 447 | bi->bi_bh = NULL; |
448 | gfs2_assert_warn(sdp, !bi->bi_clone); | 448 | gfs2_assert_warn(sdp, !bi->bi_clone); |
449 | } | 449 | } |
450 | up(&rgd->rd_mutex); | 450 | mutex_unlock(&rgd->rd_mutex); |
451 | 451 | ||
452 | return error; | 452 | return error; |
453 | } | 453 | } |