Commit 2c68ee75 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds

[PATCH] sem2mutex: jbd, j_checkpoint_mutex

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: default avatarArjan van de Ven <arjan@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f24075bd
...@@ -85,7 +85,7 @@ void __log_wait_for_space(journal_t *journal) ...@@ -85,7 +85,7 @@ void __log_wait_for_space(journal_t *journal)
if (journal->j_flags & JFS_ABORT) if (journal->j_flags & JFS_ABORT)
return; return;
spin_unlock(&journal->j_state_lock); spin_unlock(&journal->j_state_lock);
down(&journal->j_checkpoint_sem); mutex_lock(&journal->j_checkpoint_mutex);
/* /*
* Test again, another process may have checkpointed while we * Test again, another process may have checkpointed while we
...@@ -98,7 +98,7 @@ void __log_wait_for_space(journal_t *journal) ...@@ -98,7 +98,7 @@ void __log_wait_for_space(journal_t *journal)
log_do_checkpoint(journal); log_do_checkpoint(journal);
spin_lock(&journal->j_state_lock); spin_lock(&journal->j_state_lock);
} }
up(&journal->j_checkpoint_sem); mutex_unlock(&journal->j_checkpoint_mutex);
} }
} }
......
...@@ -659,8 +659,8 @@ static journal_t * journal_init_common (void) ...@@ -659,8 +659,8 @@ static journal_t * journal_init_common (void)
init_waitqueue_head(&journal->j_wait_checkpoint); init_waitqueue_head(&journal->j_wait_checkpoint);
init_waitqueue_head(&journal->j_wait_commit); init_waitqueue_head(&journal->j_wait_commit);
init_waitqueue_head(&journal->j_wait_updates); init_waitqueue_head(&journal->j_wait_updates);
init_MUTEX(&journal->j_barrier); mutex_init(&journal->j_barrier);
init_MUTEX(&journal->j_checkpoint_sem); mutex_init(&journal->j_checkpoint_mutex);
spin_lock_init(&journal->j_revoke_lock); spin_lock_init(&journal->j_revoke_lock);
spin_lock_init(&journal->j_list_lock); spin_lock_init(&journal->j_list_lock);
spin_lock_init(&journal->j_state_lock); spin_lock_init(&journal->j_state_lock);
......
...@@ -455,7 +455,7 @@ void journal_lock_updates(journal_t *journal) ...@@ -455,7 +455,7 @@ void journal_lock_updates(journal_t *journal)
* to make sure that we serialise special journal-locked operations * to make sure that we serialise special journal-locked operations
* too. * too.
*/ */
down(&journal->j_barrier); mutex_lock(&journal->j_barrier);
} }
/** /**
...@@ -470,7 +470,7 @@ void journal_unlock_updates (journal_t *journal) ...@@ -470,7 +470,7 @@ void journal_unlock_updates (journal_t *journal)
{ {
J_ASSERT(journal->j_barrier_count != 0); J_ASSERT(journal->j_barrier_count != 0);
up(&journal->j_barrier); mutex_unlock(&journal->j_barrier);
spin_lock(&journal->j_state_lock); spin_lock(&journal->j_state_lock);
--journal->j_barrier_count; --journal->j_barrier_count;
spin_unlock(&journal->j_state_lock); spin_unlock(&journal->j_state_lock);
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/journal-head.h> #include <linux/journal-head.h>
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/bit_spinlock.h> #include <linux/bit_spinlock.h>
#include <linux/mutex.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#endif #endif
...@@ -575,7 +576,7 @@ struct transaction_s ...@@ -575,7 +576,7 @@ struct transaction_s
* @j_wait_checkpoint: Wait queue to trigger checkpointing * @j_wait_checkpoint: Wait queue to trigger checkpointing
* @j_wait_commit: Wait queue to trigger commit * @j_wait_commit: Wait queue to trigger commit
* @j_wait_updates: Wait queue to wait for updates to complete * @j_wait_updates: Wait queue to wait for updates to complete
* @j_checkpoint_sem: Semaphore for locking against concurrent checkpoints * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints
* @j_head: Journal head - identifies the first unused block in the journal * @j_head: Journal head - identifies the first unused block in the journal
* @j_tail: Journal tail - identifies the oldest still-used block in the * @j_tail: Journal tail - identifies the oldest still-used block in the
* journal. * journal.
...@@ -645,7 +646,7 @@ struct journal_s ...@@ -645,7 +646,7 @@ struct journal_s
int j_barrier_count; int j_barrier_count;
/* The barrier lock itself */ /* The barrier lock itself */
struct semaphore j_barrier; struct mutex j_barrier;
/* /*
* Transactions: The current running transaction... * Transactions: The current running transaction...
...@@ -687,7 +688,7 @@ struct journal_s ...@@ -687,7 +688,7 @@ struct journal_s
wait_queue_head_t j_wait_updates; wait_queue_head_t j_wait_updates;
/* Semaphore for locking against concurrent checkpoints */ /* Semaphore for locking against concurrent checkpoints */
struct semaphore j_checkpoint_sem; struct mutex j_checkpoint_mutex;
/* /*
* Journal head: identifies the first unused block in the journal. * Journal head: identifies the first unused block in the journal.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment