vserver 1.9.5.x5
[linux-2.6.git] / fs / jbd / checkpoint.c
index 2615ad1..98d8304 100644 (file)
@@ -333,6 +333,10 @@ int log_do_checkpoint(journal_t *journal)
                                break;
                        }
                        retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count);
+                       if (cond_resched_lock(&journal->j_list_lock)) {
+                               retry = 1;
+                               break;
+                       }
                } while (jh != last_jh && !retry);
 
                if (batch_count)
@@ -487,6 +491,14 @@ int __journal_clean_checkpoint_list(journal_t *journal)
                                /* Use trylock because of the ranknig */
                                if (jbd_trylock_bh_state(jh2bh(jh)))
                                        ret += __try_to_free_cp_buf(jh);
+                               /*
+                                * This function only frees up some memory
+                                * if possible so we dont have an obligation
+                                * to finish processing. Bail out if preemption
+                                * requested:
+                                */
+                               if (need_resched())
+                                       goto out;
                        } while (jh != last_jh);
                }
        } while (transaction != last_transaction);
@@ -616,7 +628,6 @@ void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
        J_ASSERT(transaction->t_log_list == NULL);
        J_ASSERT(transaction->t_checkpoint_list == NULL);
        J_ASSERT(transaction->t_updates == 0);
-       J_ASSERT(list_empty(&transaction->t_jcb));
        J_ASSERT(journal->j_committing_transaction != transaction);
        J_ASSERT(journal->j_running_transaction != transaction);