[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>
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c
index 321945f..4df78ec 100644
--- a/fs/gfs2/glock.c
+++ b/fs/gfs2/glock.c
@@ -149,7 +149,7 @@
struct gfs2_gl_hash_bucket *bucket = gl->gl_bucket;
int rv = 0;
- down(&sdp->sd_invalidate_inodes_mutex);
+ mutex_lock(&sdp->sd_invalidate_inodes_mutex);
write_lock(&bucket->hb_lock);
if (kref_put(&gl->gl_ref, kill_glock)) {
@@ -161,7 +161,7 @@
}
write_unlock(&bucket->hb_lock);
out:
- up(&sdp->sd_invalidate_inodes_mutex);
+ mutex_unlock(&sdp->sd_invalidate_inodes_mutex);
return rv;
}
@@ -2312,9 +2312,9 @@
invalidate_inodes_mutex prevents glock_put()'s during
an invalidate_inodes() */
- down(&sdp->sd_invalidate_inodes_mutex);
+ mutex_lock(&sdp->sd_invalidate_inodes_mutex);
invalidate_inodes(sdp->sd_vfs);
- up(&sdp->sd_invalidate_inodes_mutex);
+ mutex_unlock(&sdp->sd_invalidate_inodes_mutex);
yield();
}
}