From: Arjan van de Ven 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 Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- fs/jbd/checkpoint.c | 4 ++-- fs/jbd/journal.c | 4 ++-- fs/jbd/transaction.c | 4 ++-- include/linux/jbd.h | 7 ++++--- 4 files changed, 10 insertions(+), 9 deletions(-) diff -puN fs/jbd/checkpoint.c~sem2mutex-jbd-j_checkpoint_mutex fs/jbd/checkpoint.c --- 25/fs/jbd/checkpoint.c~sem2mutex-jbd-j_checkpoint_mutex Fri Jan 13 16:12:13 2006 +++ 25-akpm/fs/jbd/checkpoint.c Fri Jan 13 16:12:13 2006 @@ -130,7 +130,7 @@ void __log_wait_for_space(journal_t *jou if (journal->j_flags & JFS_ABORT) return; 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 @@ -143,7 +143,7 @@ void __log_wait_for_space(journal_t *jou log_do_checkpoint(journal); spin_lock(&journal->j_state_lock); } - up(&journal->j_checkpoint_sem); + mutex_unlock(&journal->j_checkpoint_mutex); } } diff -puN fs/jbd/journal.c~sem2mutex-jbd-j_checkpoint_mutex fs/jbd/journal.c --- 25/fs/jbd/journal.c~sem2mutex-jbd-j_checkpoint_mutex Fri Jan 13 16:12:13 2006 +++ 25-akpm/fs/jbd/journal.c Fri Jan 13 16:12:13 2006 @@ -659,8 +659,8 @@ static journal_t * journal_init_common ( init_waitqueue_head(&journal->j_wait_checkpoint); init_waitqueue_head(&journal->j_wait_commit); init_waitqueue_head(&journal->j_wait_updates); - init_MUTEX(&journal->j_barrier); - init_MUTEX(&journal->j_checkpoint_sem); + mutex_init(&journal->j_barrier); + mutex_init(&journal->j_checkpoint_mutex); spin_lock_init(&journal->j_revoke_lock); spin_lock_init(&journal->j_list_lock); spin_lock_init(&journal->j_state_lock); diff -puN fs/jbd/transaction.c~sem2mutex-jbd-j_checkpoint_mutex fs/jbd/transaction.c --- 25/fs/jbd/transaction.c~sem2mutex-jbd-j_checkpoint_mutex Fri Jan 13 16:12:13 2006 +++ 25-akpm/fs/jbd/transaction.c Fri Jan 13 16:12:13 2006 @@ -455,7 +455,7 @@ void journal_lock_updates(journal_t *jou * to make sure that we serialise special journal-locked operations * too. */ - down(&journal->j_barrier); + mutex_lock(&journal->j_barrier); } /** @@ -470,7 +470,7 @@ void journal_unlock_updates (journal_t * { J_ASSERT(journal->j_barrier_count != 0); - up(&journal->j_barrier); + mutex_unlock(&journal->j_barrier); spin_lock(&journal->j_state_lock); --journal->j_barrier_count; spin_unlock(&journal->j_state_lock); diff -puN include/linux/jbd.h~sem2mutex-jbd-j_checkpoint_mutex include/linux/jbd.h --- 25/include/linux/jbd.h~sem2mutex-jbd-j_checkpoint_mutex Fri Jan 13 16:12:13 2006 +++ 25-akpm/include/linux/jbd.h Fri Jan 13 16:12:13 2006 @@ -28,6 +28,7 @@ #include #include #include +#include #include #endif @@ -582,7 +583,7 @@ struct transaction_s * @j_wait_checkpoint: Wait queue to trigger checkpointing * @j_wait_commit: Wait queue to trigger commit * @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_tail: Journal tail - identifies the oldest still-used block in the * journal. @@ -652,7 +653,7 @@ struct journal_s int j_barrier_count; /* The barrier lock itself */ - struct semaphore j_barrier; + struct mutex j_barrier; /* * Transactions: The current running transaction... @@ -694,7 +695,7 @@ struct journal_s wait_queue_head_t j_wait_updates; /* 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. _