diff options
Diffstat (limited to 'fs/jbd2/checkpoint.c')
| -rw-r--r-- | fs/jbd2/checkpoint.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 076d1cc44f95..1c23a0f4e8a3 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
| @@ -118,13 +118,13 @@ static int __try_to_free_cp_buf(struct journal_head *jh) | |||
| 118 | void __jbd2_log_wait_for_space(journal_t *journal) | 118 | void __jbd2_log_wait_for_space(journal_t *journal) |
| 119 | { | 119 | { |
| 120 | int nblocks, space_left; | 120 | int nblocks, space_left; |
| 121 | assert_spin_locked(&journal->j_state_lock); | 121 | /* assert_spin_locked(&journal->j_state_lock); */ |
| 122 | 122 | ||
| 123 | nblocks = jbd_space_needed(journal); | 123 | nblocks = jbd_space_needed(journal); |
| 124 | while (__jbd2_log_space_left(journal) < nblocks) { | 124 | while (__jbd2_log_space_left(journal) < nblocks) { |
| 125 | if (journal->j_flags & JBD2_ABORT) | 125 | if (journal->j_flags & JBD2_ABORT) |
| 126 | return; | 126 | return; |
| 127 | spin_unlock(&journal->j_state_lock); | 127 | write_unlock(&journal->j_state_lock); |
| 128 | mutex_lock(&journal->j_checkpoint_mutex); | 128 | mutex_lock(&journal->j_checkpoint_mutex); |
| 129 | 129 | ||
| 130 | /* | 130 | /* |
| @@ -138,7 +138,7 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
| 138 | * filesystem, so abort the journal and leave a stack | 138 | * filesystem, so abort the journal and leave a stack |
| 139 | * trace for forensic evidence. | 139 | * trace for forensic evidence. |
| 140 | */ | 140 | */ |
| 141 | spin_lock(&journal->j_state_lock); | 141 | write_lock(&journal->j_state_lock); |
| 142 | spin_lock(&journal->j_list_lock); | 142 | spin_lock(&journal->j_list_lock); |
| 143 | nblocks = jbd_space_needed(journal); | 143 | nblocks = jbd_space_needed(journal); |
| 144 | space_left = __jbd2_log_space_left(journal); | 144 | space_left = __jbd2_log_space_left(journal); |
| @@ -149,7 +149,7 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
| 149 | if (journal->j_committing_transaction) | 149 | if (journal->j_committing_transaction) |
| 150 | tid = journal->j_committing_transaction->t_tid; | 150 | tid = journal->j_committing_transaction->t_tid; |
| 151 | spin_unlock(&journal->j_list_lock); | 151 | spin_unlock(&journal->j_list_lock); |
| 152 | spin_unlock(&journal->j_state_lock); | 152 | write_unlock(&journal->j_state_lock); |
| 153 | if (chkpt) { | 153 | if (chkpt) { |
| 154 | jbd2_log_do_checkpoint(journal); | 154 | jbd2_log_do_checkpoint(journal); |
| 155 | } else if (jbd2_cleanup_journal_tail(journal) == 0) { | 155 | } else if (jbd2_cleanup_journal_tail(journal) == 0) { |
| @@ -167,7 +167,7 @@ void __jbd2_log_wait_for_space(journal_t *journal) | |||
| 167 | WARN_ON(1); | 167 | WARN_ON(1); |
| 168 | jbd2_journal_abort(journal, 0); | 168 | jbd2_journal_abort(journal, 0); |
| 169 | } | 169 | } |
| 170 | spin_lock(&journal->j_state_lock); | 170 | write_lock(&journal->j_state_lock); |
| 171 | } else { | 171 | } else { |
| 172 | spin_unlock(&journal->j_list_lock); | 172 | spin_unlock(&journal->j_list_lock); |
| 173 | } | 173 | } |
| @@ -474,7 +474,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) | |||
| 474 | * next transaction ID we will write, and where it will | 474 | * next transaction ID we will write, and where it will |
| 475 | * start. */ | 475 | * start. */ |
| 476 | 476 | ||
| 477 | spin_lock(&journal->j_state_lock); | 477 | write_lock(&journal->j_state_lock); |
| 478 | spin_lock(&journal->j_list_lock); | 478 | spin_lock(&journal->j_list_lock); |
| 479 | transaction = journal->j_checkpoint_transactions; | 479 | transaction = journal->j_checkpoint_transactions; |
| 480 | if (transaction) { | 480 | if (transaction) { |
| @@ -496,7 +496,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) | |||
| 496 | /* If the oldest pinned transaction is at the tail of the log | 496 | /* If the oldest pinned transaction is at the tail of the log |
| 497 | already then there's not much we can do right now. */ | 497 | already then there's not much we can do right now. */ |
| 498 | if (journal->j_tail_sequence == first_tid) { | 498 | if (journal->j_tail_sequence == first_tid) { |
| 499 | spin_unlock(&journal->j_state_lock); | 499 | write_unlock(&journal->j_state_lock); |
| 500 | return 1; | 500 | return 1; |
| 501 | } | 501 | } |
| 502 | 502 | ||
| @@ -516,7 +516,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) | |||
| 516 | journal->j_free += freed; | 516 | journal->j_free += freed; |
| 517 | journal->j_tail_sequence = first_tid; | 517 | journal->j_tail_sequence = first_tid; |
| 518 | journal->j_tail = blocknr; | 518 | journal->j_tail = blocknr; |
| 519 | spin_unlock(&journal->j_state_lock); | 519 | write_unlock(&journal->j_state_lock); |
| 520 | 520 | ||
| 521 | /* | 521 | /* |
| 522 | * If there is an external journal, we need to make sure that | 522 | * If there is an external journal, we need to make sure that |
| @@ -775,7 +775,7 @@ void __jbd2_journal_drop_transaction(journal_t *journal, transaction_t *transact | |||
| 775 | J_ASSERT(transaction->t_log_list == NULL); | 775 | J_ASSERT(transaction->t_log_list == NULL); |
| 776 | J_ASSERT(transaction->t_checkpoint_list == NULL); | 776 | J_ASSERT(transaction->t_checkpoint_list == NULL); |
| 777 | J_ASSERT(transaction->t_checkpoint_io_list == NULL); | 777 | J_ASSERT(transaction->t_checkpoint_io_list == NULL); |
| 778 | J_ASSERT(transaction->t_updates == 0); | 778 | J_ASSERT(atomic_read(&transaction->t_updates) == 0); |
| 779 | J_ASSERT(journal->j_committing_transaction != transaction); | 779 | J_ASSERT(journal->j_committing_transaction != transaction); |
| 780 | J_ASSERT(journal->j_running_transaction != transaction); | 780 | J_ASSERT(journal->j_running_transaction != transaction); |
| 781 | 781 | ||
