diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-14 00:54:23 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-02-03 16:47:21 -0500 |
commit | c74ec2f77a7763a4a56c6cb13ecab961e1bbb456 (patch) | |
tree | aa1ce70fae2b098a4e452fd065581268ba8a6d5c | |
parent | e2faea4ce340f199c1957986c4c3dc2de76f5746 (diff) |
[PATCH] ocfs2: Semaphore to mutex conversion.
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
-rw-r--r-- | fs/ocfs2/journal.c | 10 | ||||
-rw-r--r-- | fs/ocfs2/ocfs2.h | 3 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 65bd69d1c710..ccabed9a0aad 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -1072,10 +1072,10 @@ restart: | |||
1072 | NULL); | 1072 | NULL); |
1073 | 1073 | ||
1074 | bail: | 1074 | bail: |
1075 | down(&osb->recovery_lock); | 1075 | mutex_lock(&osb->recovery_lock); |
1076 | if (!status && | 1076 | if (!status && |
1077 | !ocfs2_node_map_is_empty(osb, &osb->recovery_map)) { | 1077 | !ocfs2_node_map_is_empty(osb, &osb->recovery_map)) { |
1078 | up(&osb->recovery_lock); | 1078 | mutex_unlock(&osb->recovery_lock); |
1079 | goto restart; | 1079 | goto restart; |
1080 | } | 1080 | } |
1081 | 1081 | ||
@@ -1083,7 +1083,7 @@ bail: | |||
1083 | mb(); /* sync with ocfs2_recovery_thread_running */ | 1083 | mb(); /* sync with ocfs2_recovery_thread_running */ |
1084 | wake_up(&osb->recovery_event); | 1084 | wake_up(&osb->recovery_event); |
1085 | 1085 | ||
1086 | up(&osb->recovery_lock); | 1086 | mutex_unlock(&osb->recovery_lock); |
1087 | 1087 | ||
1088 | mlog_exit(status); | 1088 | mlog_exit(status); |
1089 | /* no one is callint kthread_stop() for us so the kthread() api | 1089 | /* no one is callint kthread_stop() for us so the kthread() api |
@@ -1098,7 +1098,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num) | |||
1098 | mlog_entry("(node_num=%d, osb->node_num = %d)\n", | 1098 | mlog_entry("(node_num=%d, osb->node_num = %d)\n", |
1099 | node_num, osb->node_num); | 1099 | node_num, osb->node_num); |
1100 | 1100 | ||
1101 | down(&osb->recovery_lock); | 1101 | mutex_lock(&osb->recovery_lock); |
1102 | if (osb->disable_recovery) | 1102 | if (osb->disable_recovery) |
1103 | goto out; | 1103 | goto out; |
1104 | 1104 | ||
@@ -1120,7 +1120,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num) | |||
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | out: | 1122 | out: |
1123 | up(&osb->recovery_lock); | 1123 | mutex_unlock(&osb->recovery_lock); |
1124 | wake_up(&osb->recovery_event); | 1124 | wake_up(&osb->recovery_event); |
1125 | 1125 | ||
1126 | mlog_exit_void(); | 1126 | mlog_exit_void(); |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index f468c600cf92..8d8e4779df92 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/rbtree.h> | 33 | #include <linux/rbtree.h> |
34 | #include <linux/workqueue.h> | 34 | #include <linux/workqueue.h> |
35 | #include <linux/kref.h> | 35 | #include <linux/kref.h> |
36 | #include <linux/mutex.h> | ||
36 | 37 | ||
37 | #include "cluster/nodemanager.h" | 38 | #include "cluster/nodemanager.h" |
38 | #include "cluster/heartbeat.h" | 39 | #include "cluster/heartbeat.h" |
@@ -233,7 +234,7 @@ struct ocfs2_super | |||
233 | struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */ | 234 | struct proc_dir_entry *proc_sub_dir; /* points to /proc/fs/ocfs2/<maj_min> */ |
234 | 235 | ||
235 | atomic_t vol_state; | 236 | atomic_t vol_state; |
236 | struct semaphore recovery_lock; | 237 | struct mutex recovery_lock; |
237 | struct task_struct *recovery_thread_task; | 238 | struct task_struct *recovery_thread_task; |
238 | int disable_recovery; | 239 | int disable_recovery; |
239 | wait_queue_head_t checkpoint_event; | 240 | wait_queue_head_t checkpoint_event; |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c44075d4b576..e7e17bdf6296 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1137,9 +1137,9 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) | |||
1137 | 1137 | ||
1138 | /* disable any new recovery threads and wait for any currently | 1138 | /* disable any new recovery threads and wait for any currently |
1139 | * running ones to exit. Do this before setting the vol_state. */ | 1139 | * running ones to exit. Do this before setting the vol_state. */ |
1140 | down(&osb->recovery_lock); | 1140 | mutex_lock(&osb->recovery_lock); |
1141 | osb->disable_recovery = 1; | 1141 | osb->disable_recovery = 1; |
1142 | up(&osb->recovery_lock); | 1142 | mutex_unlock(&osb->recovery_lock); |
1143 | wait_event(osb->recovery_event, !ocfs2_recovery_thread_running(osb)); | 1143 | wait_event(osb->recovery_event, !ocfs2_recovery_thread_running(osb)); |
1144 | 1144 | ||
1145 | /* At this point, we know that no more recovery threads can be | 1145 | /* At this point, we know that no more recovery threads can be |
@@ -1283,7 +1283,7 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1283 | snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u", | 1283 | snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u", |
1284 | MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); | 1284 | MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev)); |
1285 | 1285 | ||
1286 | init_MUTEX(&osb->recovery_lock); | 1286 | mutex_init(&osb->recovery_lock); |
1287 | 1287 | ||
1288 | osb->disable_recovery = 0; | 1288 | osb->disable_recovery = 0; |
1289 | osb->recovery_thread_task = NULL; | 1289 | osb->recovery_thread_task = NULL; |