summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/incore.h
diff options
context:
space:
mode:
authorSteven Whitehouse2006-03-29 16:12:12 +0200
committerSteven Whitehouse2006-03-29 16:12:12 +0200
commit484adff8a06cb5d952832f5487ae863f54c0fb69 (patch)
treee43a9387a3a313cfdb4a34298d532dc7a1b7391c /fs/gfs2/incore.h
parent[DLM] Look for "nodir" in the lockspace mount options (diff)
downloadkernel-qcow2-linux-484adff8a06cb5d952832f5487ae863f54c0fb69.tar.gz
kernel-qcow2-linux-484adff8a06cb5d952832f5487ae863f54c0fb69.tar.xz
kernel-qcow2-linux-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/incore.h')
-rw-r--r--fs/gfs2/incore.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index be307185f492..35163b562460 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -611,10 +611,6 @@ struct gfs2_sbd {
/* Log stuff */
spinlock_t sd_log_lock;
- atomic_t sd_log_trans_count;
- wait_queue_head_t sd_log_trans_wq;
- atomic_t sd_log_flush_count;
- wait_queue_head_t sd_log_flush_wq;
unsigned int sd_log_blks_reserved;
unsigned int sd_log_commited_buf;
@@ -643,7 +639,7 @@ struct gfs2_sbd {
int sd_log_idle;
unsigned long sd_log_flush_time;
- struct mutex sd_log_flush_lock;
+ struct rw_semaphore sd_log_flush_lock;
struct list_head sd_log_flush_list;
unsigned int sd_log_flush_head;