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()
680 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
779 journal_t *journal = handle->h_transaction->t_journal; in ocfs2_journal_dirty() local
785 jbd2_journal_abort(journal, status); in ocfs2_journal_dirty()
796 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
802 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
803 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
805 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
807 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
808 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
818 struct ocfs2_journal *journal; in ocfs2_journal_alloc() local
820 journal = kzalloc(sizeof(struct ocfs2_journal), GFP_KERNEL); in ocfs2_journal_alloc()
821 if (!journal) { in ocfs2_journal_alloc()
826 osb->journal = journal; in ocfs2_journal_alloc()
827 journal->j_osb = osb; in ocfs2_journal_alloc()
829 atomic_set(&journal->j_num_trans, 0); in ocfs2_journal_alloc()
830 init_rwsem(&journal->j_trans_barrier); in ocfs2_journal_alloc()
831 init_waitqueue_head(&journal->j_checkpointed); in ocfs2_journal_alloc()
832 spin_lock_init(&journal->j_lock); in ocfs2_journal_alloc()
833 journal->j_trans_id = 1UL; in ocfs2_journal_alloc()
834 INIT_LIST_HEAD(&journal->j_la_cleanups); in ocfs2_journal_alloc()
835 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery); in ocfs2_journal_alloc()
836 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_alloc()
860 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_init() local
865 BUG_ON(!journal); in ocfs2_journal_init()
922 journal->j_journal = j_journal; in ocfs2_journal_init()
923 journal->j_journal->j_submit_inode_data_buffers = in ocfs2_journal_init()
925 journal->j_journal->j_finish_inode_data_buffers = in ocfs2_journal_init()
927 journal->j_inode = inode; in ocfs2_journal_init()
928 journal->j_bh = bh; in ocfs2_journal_init()
932 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
964 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
965 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
986 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
999 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
1006 journal = osb->journal; in ocfs2_journal_shutdown()
1007 if (!journal) in ocfs2_journal_shutdown()
1010 inode = journal->j_inode; in ocfs2_journal_shutdown()
1012 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
1019 num_running_trans = atomic_read(&(osb->journal->j_num_trans)); in ocfs2_journal_shutdown()
1026 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
1038 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
1041 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1042 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_shutdown()
1043 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1049 if (!jbd2_journal_destroy(journal->j_journal) && !status) { in ocfs2_journal_shutdown()
1058 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1065 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1066 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1068 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1072 kfree(journal); in ocfs2_journal_shutdown()
1073 osb->journal = NULL; in ocfs2_journal_shutdown()
1077 journal_t *journal, in ocfs2_clear_journal_error() argument
1082 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1089 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1090 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1094 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1099 BUG_ON(!journal); in ocfs2_journal_load()
1101 osb = journal->j_osb; in ocfs2_journal_load()
1103 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1109 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1112 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_load()
1113 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_journal_load()
1114 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_load()
1146 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1150 BUG_ON(!journal); in ocfs2_journal_wipe()
1152 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1158 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1262 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1264 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1272 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1274 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1275 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1276 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1333 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1364 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1365 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1366 queue_work(journal->j_osb->ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1367 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1374 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1381 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1397 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1446 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1511 ocfs2_queue_recovery_completion(osb->journal, in __ocfs2_recovery_thread()
1617 journal_t *journal = NULL; in ocfs2_replay_journal() local
1686 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1687 if (IS_ERR(journal)) { in ocfs2_replay_journal()
1689 status = PTR_ERR(journal); in ocfs2_replay_journal()
1693 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1697 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1701 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1704 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1705 status = jbd2_journal_flush(journal, 0); in ocfs2_replay_journal()
1706 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1727 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1800 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
1989 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2331 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2338 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2341 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2360 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2364 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()