Lines Matching refs:journal
61 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
154 ocfs2_queue_recovery_completion(osb->journal, i, NULL, in ocfs2_queue_replay_slots()
296 struct ocfs2_journal *journal = NULL; in ocfs2_commit_cache() local
298 journal = osb->journal; in ocfs2_commit_cache()
301 down_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
303 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
306 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
310 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_commit_cache()
311 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_commit_cache()
312 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_commit_cache()
314 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
319 ocfs2_inc_trans_id(journal); in ocfs2_commit_cache()
321 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
322 atomic_set(&journal->j_num_trans, 0); in ocfs2_commit_cache()
323 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
325 trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed); in ocfs2_commit_cache()
328 wake_up(&journal->j_checkpointed); in ocfs2_commit_cache()
335 journal_t *journal = osb->journal->j_journal; in ocfs2_start_trans() local
338 BUG_ON(!osb || !osb->journal->j_journal); in ocfs2_start_trans()
343 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE); in ocfs2_start_trans()
348 return jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
352 down_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
354 handle = jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
356 up_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
361 if (is_journal_aborted(journal)) { in ocfs2_start_trans()
367 atomic_inc(&(osb->journal->j_num_trans)); in ocfs2_start_trans()
377 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_trans() local
387 up_read(&journal->j_trans_barrier); in ocfs2_commit_trans()
682 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
781 journal_t *journal = handle->h_transaction->t_journal; in ocfs2_journal_dirty() local
788 jbd2_journal_abort(journal, status); in ocfs2_journal_dirty()
798 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
804 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
805 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
807 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
809 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
810 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
813 int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) in ocfs2_journal_init() argument
823 BUG_ON(!journal); in ocfs2_journal_init()
825 osb = journal->j_osb; in ocfs2_journal_init()
883 journal->j_journal = j_journal; in ocfs2_journal_init()
884 journal->j_journal->j_submit_inode_data_buffers = in ocfs2_journal_init()
886 journal->j_journal->j_finish_inode_data_buffers = in ocfs2_journal_init()
888 journal->j_inode = inode; in ocfs2_journal_init()
889 journal->j_bh = bh; in ocfs2_journal_init()
893 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
925 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
926 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
947 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
960 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
967 journal = osb->journal; in ocfs2_journal_shutdown()
968 if (!journal) in ocfs2_journal_shutdown()
971 inode = journal->j_inode; in ocfs2_journal_shutdown()
973 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
980 num_running_trans = atomic_read(&(osb->journal->j_num_trans)); in ocfs2_journal_shutdown()
987 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
999 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
1002 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1003 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_shutdown()
1004 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1010 if (!jbd2_journal_destroy(journal->j_journal) && !status) { in ocfs2_journal_shutdown()
1019 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1026 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1027 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1029 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1037 journal_t *journal, in ocfs2_clear_journal_error() argument
1042 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1049 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1050 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1054 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1059 BUG_ON(!journal); in ocfs2_journal_load()
1061 osb = journal->j_osb; in ocfs2_journal_load()
1063 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1069 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1072 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_load()
1073 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_load()
1074 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_load()
1106 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1110 BUG_ON(!journal); in ocfs2_journal_wipe()
1112 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1118 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1222 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1224 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1232 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1234 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1235 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1236 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1293 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1324 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1325 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1326 queue_work(journal->j_osb->ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1327 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1334 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1341 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1357 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1406 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1471 ocfs2_queue_recovery_completion(osb->journal, in __ocfs2_recovery_thread()
1580 journal_t *journal = NULL; in ocfs2_replay_journal() local
1649 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1650 if (journal == NULL) { in ocfs2_replay_journal()
1656 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1661 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1665 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1668 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1669 status = jbd2_journal_flush(journal, 0); in ocfs2_replay_journal()
1670 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1692 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1765 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
1954 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2296 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2303 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2306 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2325 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2329 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()