• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/hfsplus_journal/

Lines Matching refs:journal

74  * __hfsplus__log_wait_for_space: wait until there is space in the journal.
79 void __hfsplus__log_wait_for_space(hfsplus_jbd_t *journal)
82 assert_spin_locked(&journal->j_state_lock);
84 nblocks = hfsplus_jbd_space_needed(journal);
85 while (__hfsplus__log_space_left(journal) < nblocks) {
86 if (journal->j_flags & JFS_ABORT)
88 spin_unlock(&journal->j_state_lock);
89 down(&journal->j_checkpoint_sem);
95 spin_lock(&journal->j_state_lock);
96 nblocks = hfsplus_jbd_space_needed(journal);
97 if (__hfsplus__log_space_left(journal) < nblocks) {
98 spin_unlock(&journal->j_state_lock);
99 hfsplus_jbd_log_do_checkpoint(journal);
100 spin_lock(&journal->j_state_lock);
102 up(&journal->j_checkpoint_sem);
111 static void jbd_sync_bh(hfsplus_jbd_t *journal, struct buffer_head *bh)
114 spin_unlock(&journal->j_list_lock);
132 static int __cleanup_transaction(hfsplus_jbd_t *journal, hfsplus_transaction_t *transaction)
138 assert_spin_locked(&journal->j_list_lock);
150 spin_unlock(&journal->j_list_lock);
162 jbd_sync_bh(journal, bh);
170 spin_unlock(&journal->j_list_lock);
172 hfsplus_log_start_commit(journal, tid);
173 hfsplus_jbd_log_wait_commit(journal, tid);
196 spin_lock(&journal->j_list_lock);
203 __flush_batch(hfsplus_jbd_t *journal, struct buffer_head **bhs, int *batch_count)
207 spin_unlock(&journal->j_list_lock);
209 spin_lock(&journal->j_list_lock);
228 static int __flush_buffer(hfsplus_jbd_t *journal, struct hfsplus_jbd_head *jh,
240 * possibly block, while still holding the journal lock.
253 __flush_batch(journal, bhs, batch_count);
282 * The journal should be locked before calling this function.
284 int hfsplus_jbd_log_do_checkpoint(hfsplus_jbd_t *journal)
295 * journal straight away.
297 result = cleanup_hfsplus_jbd_tail(journal);
310 spin_lock(&journal->j_list_lock);
311 while (journal->j_checkpoint_transactions) {
318 transaction = journal->j_checkpoint_transactions;
330 jbd_sync_bh(journal, bh);
331 spin_lock(&journal->j_list_lock);
335 retry = __flush_buffer(journal, jh, bhs, &batch_count, &drop_count);
336 if (cond_resched_lock(&journal->j_list_lock)) {
343 __flush_batch(journal, bhs, &batch_count);
351 if (journal->j_checkpoint_transactions != transaction)
366 cleanup_ret = __cleanup_transaction(journal, transaction);
368 if (journal->j_checkpoint_transactions != transaction)
371 spin_unlock(&journal->j_list_lock);
372 result = cleanup_hfsplus_jbd_tail(journal);
380 * Check the list of checkpoint transactions for the journal to see if
382 * in the journal superblock. If so, we can instantly roll the
387 * Called with the journal lock held.
391 * main filesystem area rather than to the journal, so it can proceed
392 * even in abort state, but we must not update the journal superblock if
396 int cleanup_hfsplus_jbd_tail(hfsplus_jbd_t *journal)
409 spin_lock(&journal->j_state_lock);
410 spin_lock(&journal->j_list_lock);
411 transaction = journal->j_checkpoint_transactions;
415 } else if ((transaction = journal->j_committing_transaction) != NULL) {
418 } else if ((transaction = journal->j_running_transaction) != NULL) {
420 blocknr = journal->j_head;
422 first_tid = journal->j_transaction_sequence;
423 blocknr = journal->j_head;
425 spin_unlock(&journal->j_list_lock);
430 if (journal->j_tail_sequence == first_tid) {
431 spin_unlock(&journal->j_state_lock);
438 freed = blocknr - journal->j_tail;
439 if (blocknr < journal->j_tail)
440 freed = freed + journal->j_last - journal->j_first;
443 hfsplus_journal_header_start_update(journal, freed);
447 "Cleaning journal tail from %d to %d (offset %lu), "
449 journal->j_tail_sequence, first_tid, blocknr, freed);
451 journal->j_free += freed;
452 journal->j_tail_sequence = first_tid;
453 journal->j_tail = blocknr;
454 spin_unlock(&journal->j_state_lock);
455 if (!(journal->j_flags & JFS_ABORT))
456 hfsplus_jbd_update_superblock(journal, 1);
466 * Find all the written-back checkpoint buffers in the journal and release them.
468 * Called with the journal locked.
473 int __hfsplus_jbd_clean_checkpoint_list(hfsplus_jbd_t *journal)
478 transaction = journal->j_checkpoint_transactions;
528 * This function is called with the journal locked.
535 hfsplus_jbd_t *journal;
543 journal = transaction->t_journal;
560 if (transaction == journal->j_committing_transaction) {
568 __hfsplus_jbd_drop_transaction(journal, transaction);
572 wake_up(&journal->j_wait_logspace);
582 * Called with the journal locked.
611 * Called with the journal locked.
615 void __hfsplus_jbd_drop_transaction(hfsplus_jbd_t *journal, hfsplus_transaction_t *transaction)
617 assert_spin_locked(&journal->j_list_lock);
621 if (journal->j_checkpoint_transactions == transaction)
622 journal->j_checkpoint_transactions =
624 if (journal->j_checkpoint_transactions == transaction)
625 journal->j_checkpoint_transactions = NULL;
637 HFSPLUS_J_ASSERT(journal->j_committing_transaction != transaction);
638 HFSPLUS_J_ASSERT(journal->j_running_transaction != transaction);