aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_fstype.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-29 09:12:12 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-29 09:12:12 -0500
commit484adff8a06cb5d952832f5487ae863f54c0fb69 (patch)
treee43a9387a3a313cfdb4a34298d532dc7a1b7391c /fs/gfs2/ops_fstype.c
parent[DLM] Look for "nodir" in the lockspace mount options (diff)
downloadlinux-dev-484adff8a06cb5d952832f5487ae863f54c0fb69.tar.xz
linux-dev-484adff8a06cb5d952832f5487ae863f54c0fb69.zip
[GFS2] Update locking in log.c
Replace the lock_for_trans()/lock_for_flush() functions with an rwsem. In fact the sd_log_flush_lock becomes an rwsem (the write part of it) and is extended slightly to cover everything that the lock_for_flush() used to cover. The read part of the lock is instead of lock_for_trans(). This corrects the races in the original code and reduces the code size. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_fstype.c')
-rw-r--r--fs/gfs2/ops_fstype.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index 2628bf326334..5166455b9fdd 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -88,8 +88,6 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
mutex_init(&sdp->sd_quota_mutex);
spin_lock_init(&sdp->sd_log_lock);
- init_waitqueue_head(&sdp->sd_log_trans_wq);
- init_waitqueue_head(&sdp->sd_log_flush_wq);
INIT_LIST_HEAD(&sdp->sd_log_le_gl);
INIT_LIST_HEAD(&sdp->sd_log_le_buf);
@@ -101,7 +99,7 @@ static struct gfs2_sbd *init_sbd(struct super_block *sb)
INIT_LIST_HEAD(&sdp->sd_ail1_list);
INIT_LIST_HEAD(&sdp->sd_ail2_list);
- mutex_init(&sdp->sd_log_flush_lock);
+ init_rwsem(&sdp->sd_log_flush_lock);
INIT_LIST_HEAD(&sdp->sd_log_flush_list);
INIT_LIST_HEAD(&sdp->sd_revoke_list);