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

Lines Matching defs:journal

4  * journal.c
42 #include "journal.h"
73 struct ocfs2_journal *journal = NULL;
77 journal = osb->journal;
79 /* Flush all pending commits and checkpoint the journal. */
80 down_write(&journal->j_trans_barrier);
82 if (atomic_read(&journal->j_num_trans) == 0) {
83 up_write(&journal->j_trans_barrier);
88 journal_lock_updates(journal->j_journal);
89 status = journal_flush(journal->j_journal);
90 journal_unlock_updates(journal->j_journal);
92 up_write(&journal->j_trans_barrier);
97 old_id = ocfs2_inc_trans_id(journal);
99 flushed = atomic_read(&journal->j_num_trans);
100 atomic_set(&journal->j_num_trans, 0);
101 up_write(&journal->j_trans_barrier);
104 journal->j_trans_id, flushed);
107 wake_up(&journal->j_checkpointed);
118 journal_t *journal = osb->journal->j_journal;
121 BUG_ON(!osb || !osb->journal->j_journal);
126 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);
135 down_read(&osb->journal->j_trans_barrier);
137 handle = journal_start(journal, max_buffs);
139 up_read(&osb->journal->j_trans_barrier);
143 if (is_journal_aborted(journal)) {
144 ocfs2_abort(osb->sb, "Detected aborted journal");
149 atomic_inc(&(osb->journal->j_num_trans));
159 struct ocfs2_journal *journal = osb->journal;
167 up_read(&journal->j_trans_barrier);
250 ocfs2_set_inode_lock_trans(OCFS2_SB(inode->i_sb)->journal, inode);
311 journal_t *journal = osb->journal->j_journal;
313 spin_lock(&journal->j_state_lock);
314 journal->j_commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL;
316 journal->j_flags |= JFS_BARRIER;
318 journal->j_flags &= ~JFS_BARRIER;
319 spin_unlock(&journal->j_state_lock);
322 int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
325 struct inode *inode = NULL; /* the journal inode */
334 BUG_ON(!journal);
336 osb = journal->j_osb;
338 /* already have the inode for our journal */
357 /* Skip recovery waits here - journal inode metadata never
363 mlog(ML_ERROR, "Could not get lock on journal!\n");
382 /* call the kernels journal init function now */
385 mlog(ML_ERROR, "Linux journal layer error\n");
396 journal->j_journal = j_journal;
397 journal->j_inode = inode;
398 journal->j_bh = bh;
402 journal->j_state = OCFS2_JOURNAL_LOADED;
426 struct ocfs2_journal *journal = osb->journal;
427 struct buffer_head *bh = journal->j_bh;
452 status = ocfs2_write_block(osb, bh, journal->j_inode);
462 * If the journal has been kmalloc'd it needs to be freed after this
467 struct ocfs2_journal *journal = NULL;
476 journal = osb->journal;
477 if (!journal)
480 inode = journal->j_inode;
482 if (journal->j_state != OCFS2_JOURNAL_LOADED)
489 num_running_trans = atomic_read(&(osb->journal->j_num_trans));
491 mlog(0, "Shutting down journal: must wait on %d "
495 /* Do a commit_cache here. It will flush our journal, *and*
499 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN;
503 * completely destroy the journal. */
511 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0);
514 journal_lock_updates(journal->j_journal);
515 status = journal_flush(journal->j_journal);
516 journal_unlock_updates(journal->j_journal);
524 * will leave dirty metadata in a "clean" journal
531 /* Shutdown the kernel journal system */
532 journal_destroy(journal->j_journal);
536 /* unlock our journal */
539 brelse(journal->j_bh);
540 journal->j_bh = NULL;
542 journal->j_state = OCFS2_JOURNAL_FREE;
544 // up_write(&journal->j_trans_barrier);
552 journal_t *journal,
557 olderr = journal_errno(journal);
560 "journal %u.\n", olderr, slot);
564 journal_ack_err(journal);
565 journal_clear_err(journal);
569 int ocfs2_journal_load(struct ocfs2_journal *journal, int local)
576 if (!journal)
579 osb = journal->j_osb;
581 status = journal_load(journal->j_journal);
583 mlog(ML_ERROR, "Failed to load journal!\n");
587 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num);
616 * mark the journal clean */
617 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full)
623 BUG_ON(!journal);
625 status = journal_wipe(journal->j_journal, full);
631 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0);
641 * JBD Might read a cached version of another nodes journal file. We
675 /* We are reading journal data which should not
721 struct ocfs2_journal *journal =
723 struct ocfs2_super *osb = journal->j_osb;
733 spin_lock(&journal->j_lock);
734 list_splice_init(&journal->j_la_cleanups, &tmp_la_list);
735 spin_unlock(&journal->j_lock);
783 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
810 spin_lock(&journal->j_lock);
811 list_add_tail(&item->lri_list, &journal->j_la_cleanups);
812 queue_work(ocfs2_wq, &journal->j_recovery_work);
813 spin_unlock(&journal->j_lock);
820 struct ocfs2_journal *journal = osb->journal;
825 ocfs2_queue_recovery_completion(journal,
880 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL,
938 /* Does the actual journal replay and marks the journal inode as
939 * clean. Will only replay if the journal inode is marked dirty. */
949 journal_t *journal = NULL;
972 mlog(ML_ERROR, "Could not lock journal!\n");
999 journal = journal_init_inode(inode);
1000 if (journal == NULL) {
1001 mlog(ML_ERROR, "Linux journal layer error\n");
1006 status = journal_load(journal);
1011 journal_destroy(journal);
1015 ocfs2_clear_journal_error(osb->sb, journal, slot_num);
1017 /* wipe the journal */
1018 mlog(0, "flushing the journal.\n");
1019 journal_lock_updates(journal);
1020 status = journal_flush(journal);
1021 journal_unlock_updates(journal);
1037 journal_destroy(journal);
1040 /* drop the lock on this nodes journal */
1056 * - Replay it's journal
1099 /* Stamp a clean local alloc file AFTER recovering the journal... */
1121 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy,
1131 /* Test node liveness by trylocking his journal. If we get the lock,
1195 * is not in the recovery map. We trylock his journal
1447 struct ocfs2_journal *journal = osb->journal;
1454 atomic_read(&journal->j_num_trans) == 0)) {
1457 atomic_read(&journal->j_num_trans)
1464 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){
1468 atomic_read(&journal->j_num_trans));
1475 /* Look for a dirty journal without taking any cluster locks. Used for
1484 struct inode *journal = NULL;
1487 journal = ocfs2_get_system_file_inode(osb,
1490 if (!journal || is_bad_inode(journal)) {
1497 ret = ocfs2_read_block(osb, OCFS2_I(journal)->ip_blkno, &di_bh,
1498 0, journal);
1516 if (journal)
1517 iput(journal);