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()
665 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
799 journal_t *journal = handle->h_transaction->t_journal; in ocfs2_journal_dirty() local
809 jbd2_journal_abort(journal, status); in ocfs2_journal_dirty()
818 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
824 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
825 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
827 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
829 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
830 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
840 struct ocfs2_journal *journal; in ocfs2_journal_alloc() local
842 journal = kzalloc(sizeof(struct ocfs2_journal), GFP_KERNEL); in ocfs2_journal_alloc()
843 if (!journal) { in ocfs2_journal_alloc()
848 osb->journal = journal; in ocfs2_journal_alloc()
849 journal->j_osb = osb; in ocfs2_journal_alloc()
851 atomic_set(&journal->j_num_trans, 0); in ocfs2_journal_alloc()
852 init_rwsem(&journal->j_trans_barrier); in ocfs2_journal_alloc()
853 init_waitqueue_head(&journal->j_checkpointed); in ocfs2_journal_alloc()
854 spin_lock_init(&journal->j_lock); in ocfs2_journal_alloc()
855 journal->j_trans_id = 1UL; in ocfs2_journal_alloc()
856 INIT_LIST_HEAD(&journal->j_la_cleanups); in ocfs2_journal_alloc()
857 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery); in ocfs2_journal_alloc()
858 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_alloc()
882 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_init() local
887 BUG_ON(!journal); in ocfs2_journal_init()
944 journal->j_journal = j_journal; in ocfs2_journal_init()
945 journal->j_journal->j_submit_inode_data_buffers = in ocfs2_journal_init()
947 journal->j_journal->j_finish_inode_data_buffers = in ocfs2_journal_init()
949 journal->j_inode = inode; in ocfs2_journal_init()
950 journal->j_bh = bh; in ocfs2_journal_init()
954 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
986 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
987 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
1008 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
1021 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
1028 journal = osb->journal; in ocfs2_journal_shutdown()
1029 if (!journal) in ocfs2_journal_shutdown()
1032 inode = journal->j_inode; in ocfs2_journal_shutdown()
1034 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
1041 num_running_trans = atomic_read(&(osb->journal->j_num_trans)); in ocfs2_journal_shutdown()
1048 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
1060 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
1063 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1064 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_shutdown()
1065 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1071 if (!jbd2_journal_destroy(journal->j_journal) && !status) { in ocfs2_journal_shutdown()
1080 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1087 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1088 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1090 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1094 kfree(journal); in ocfs2_journal_shutdown()
1095 osb->journal = NULL; in ocfs2_journal_shutdown()
1099 journal_t *journal, in ocfs2_clear_journal_error() argument
1104 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1111 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1112 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1116 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1121 BUG_ON(!journal); in ocfs2_journal_load()
1123 osb = journal->j_osb; in ocfs2_journal_load()
1125 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1131 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1134 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_load()
1135 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_load()
1136 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_load()
1168 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1172 BUG_ON(!journal); in ocfs2_journal_wipe()
1174 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1180 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1284 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1286 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1294 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1296 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1297 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1298 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1355 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1386 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1387 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1388 queue_work(journal->j_osb->ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1389 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1396 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1403 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1419 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1468 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1533 ocfs2_queue_recovery_completion(osb->journal, in __ocfs2_recovery_thread()
1639 journal_t *journal = NULL; in ocfs2_replay_journal() local
1708 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1709 if (IS_ERR(journal)) { in ocfs2_replay_journal()
1711 status = PTR_ERR(journal); in ocfs2_replay_journal()
1715 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1719 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1723 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1726 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1727 status = jbd2_journal_flush(journal, 0); in ocfs2_replay_journal()
1728 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1749 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1822 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
2011 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2353 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2360 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2363 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2382 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2386 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()