Lines Matching refs:journal
62 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
155 ocfs2_queue_recovery_completion(osb->journal, i, NULL, in ocfs2_queue_replay_slots()
294 struct ocfs2_journal *journal = NULL; in ocfs2_commit_cache() local
296 journal = osb->journal; in ocfs2_commit_cache()
299 down_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
301 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
304 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
308 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_commit_cache()
309 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_commit_cache()
310 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_commit_cache()
312 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
317 ocfs2_inc_trans_id(journal); in ocfs2_commit_cache()
319 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
320 atomic_set(&journal->j_num_trans, 0); in ocfs2_commit_cache()
321 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
323 trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed); in ocfs2_commit_cache()
326 wake_up(&journal->j_checkpointed); in ocfs2_commit_cache()
333 journal_t *journal = osb->journal->j_journal; in ocfs2_start_trans() local
336 BUG_ON(!osb || !osb->journal->j_journal); in ocfs2_start_trans()
341 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE); in ocfs2_start_trans()
346 return jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
350 down_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
352 handle = jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
354 up_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
359 if (is_journal_aborted(journal)) { in ocfs2_start_trans()
365 atomic_inc(&(osb->journal->j_num_trans)); in ocfs2_start_trans()
375 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_trans() local
385 up_read(&journal->j_trans_barrier); in ocfs2_commit_trans()
682 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
816 journal_t *journal = handle->h_transaction->t_journal; in ocfs2_journal_dirty() local
826 jbd2_journal_abort(journal, status); in ocfs2_journal_dirty()
835 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
841 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
842 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
844 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
846 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
847 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
857 struct ocfs2_journal *journal; in ocfs2_journal_alloc() local
859 journal = kzalloc(sizeof(struct ocfs2_journal), GFP_KERNEL); in ocfs2_journal_alloc()
860 if (!journal) { in ocfs2_journal_alloc()
865 osb->journal = journal; in ocfs2_journal_alloc()
866 journal->j_osb = osb; in ocfs2_journal_alloc()
868 atomic_set(&journal->j_num_trans, 0); in ocfs2_journal_alloc()
869 init_rwsem(&journal->j_trans_barrier); in ocfs2_journal_alloc()
870 init_waitqueue_head(&journal->j_checkpointed); in ocfs2_journal_alloc()
871 spin_lock_init(&journal->j_lock); in ocfs2_journal_alloc()
872 journal->j_trans_id = 1UL; in ocfs2_journal_alloc()
873 INIT_LIST_HEAD(&journal->j_la_cleanups); in ocfs2_journal_alloc()
874 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery); in ocfs2_journal_alloc()
875 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_alloc()
899 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_init() local
904 BUG_ON(!journal); in ocfs2_journal_init()
961 journal->j_journal = j_journal; in ocfs2_journal_init()
962 journal->j_journal->j_submit_inode_data_buffers = in ocfs2_journal_init()
964 journal->j_journal->j_finish_inode_data_buffers = in ocfs2_journal_init()
966 journal->j_inode = inode; in ocfs2_journal_init()
967 journal->j_bh = bh; in ocfs2_journal_init()
971 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
1003 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
1004 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
1025 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
1038 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
1045 journal = osb->journal; in ocfs2_journal_shutdown()
1046 if (!journal) in ocfs2_journal_shutdown()
1049 inode = journal->j_inode; in ocfs2_journal_shutdown()
1051 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
1058 num_running_trans = atomic_read(&(journal->j_num_trans)); in ocfs2_journal_shutdown()
1065 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
1077 BUG_ON(atomic_read(&(journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
1080 (journal->j_journal->j_flags & JBD2_LOADED)) { in ocfs2_journal_shutdown()
1081 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1082 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_shutdown()
1083 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1089 if (!jbd2_journal_destroy(journal->j_journal) && !status) { in ocfs2_journal_shutdown()
1098 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1105 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1106 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1108 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1112 kfree(journal); in ocfs2_journal_shutdown()
1113 osb->journal = NULL; in ocfs2_journal_shutdown()
1117 journal_t *journal, in ocfs2_clear_journal_error() argument
1122 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1129 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1130 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1134 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1139 BUG_ON(!journal); in ocfs2_journal_load()
1141 osb = journal->j_osb; in ocfs2_journal_load()
1143 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1149 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1152 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_load()
1153 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_load()
1154 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_load()
1186 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1190 BUG_ON(!journal); in ocfs2_journal_wipe()
1192 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1198 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1302 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1304 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1312 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1314 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1315 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1316 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1373 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1404 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1405 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1406 queue_work(journal->j_osb->ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1407 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1414 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1421 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1437 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1486 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1551 ocfs2_queue_recovery_completion(osb->journal, in __ocfs2_recovery_thread()
1657 journal_t *journal = NULL; in ocfs2_replay_journal() local
1726 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1727 if (IS_ERR(journal)) { in ocfs2_replay_journal()
1729 status = PTR_ERR(journal); in ocfs2_replay_journal()
1733 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1737 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1741 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1744 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1745 status = jbd2_journal_flush(journal, 0); in ocfs2_replay_journal()
1746 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1767 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1840 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
2029 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2371 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2378 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2381 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2400 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2404 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()