Lines Matching refs:journal

77 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
170 ocfs2_queue_recovery_completion(osb->journal, i, NULL, in ocfs2_queue_replay_slots()
311 struct ocfs2_journal *journal = NULL; in ocfs2_commit_cache() local
313 journal = osb->journal; in ocfs2_commit_cache()
316 down_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
318 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
321 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
325 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_commit_cache()
326 status = jbd2_journal_flush(journal->j_journal); in ocfs2_commit_cache()
327 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_commit_cache()
329 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
334 ocfs2_inc_trans_id(journal); in ocfs2_commit_cache()
336 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
337 atomic_set(&journal->j_num_trans, 0); in ocfs2_commit_cache()
338 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
340 trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed); in ocfs2_commit_cache()
343 wake_up(&journal->j_checkpointed); in ocfs2_commit_cache()
350 journal_t *journal = osb->journal->j_journal; in ocfs2_start_trans() local
353 BUG_ON(!osb || !osb->journal->j_journal); in ocfs2_start_trans()
358 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE); in ocfs2_start_trans()
363 return jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
367 down_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
369 handle = jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
371 up_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
376 if (is_journal_aborted(journal)) { in ocfs2_start_trans()
382 atomic_inc(&(osb->journal->j_num_trans)); in ocfs2_start_trans()
392 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_trans() local
402 up_read(&journal->j_trans_barrier); in ocfs2_commit_trans()
682 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
785 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
791 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
792 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
794 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
796 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
797 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
800 int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) in ocfs2_journal_init() argument
810 BUG_ON(!journal); in ocfs2_journal_init()
812 osb = journal->j_osb; in ocfs2_journal_init()
870 journal->j_journal = j_journal; in ocfs2_journal_init()
871 journal->j_inode = inode; in ocfs2_journal_init()
872 journal->j_bh = bh; in ocfs2_journal_init()
876 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
908 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
909 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
930 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
943 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
950 journal = osb->journal; in ocfs2_journal_shutdown()
951 if (!journal) in ocfs2_journal_shutdown()
954 inode = journal->j_inode; in ocfs2_journal_shutdown()
956 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
963 num_running_trans = atomic_read(&(osb->journal->j_num_trans)); in ocfs2_journal_shutdown()
970 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
982 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
985 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
986 status = jbd2_journal_flush(journal->j_journal); in ocfs2_journal_shutdown()
987 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1003 jbd2_journal_destroy(journal->j_journal); in ocfs2_journal_shutdown()
1004 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1011 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1012 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1014 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1023 journal_t *journal, in ocfs2_clear_journal_error() argument
1028 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1035 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1036 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1040 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1045 BUG_ON(!journal); in ocfs2_journal_load()
1047 osb = journal->j_osb; in ocfs2_journal_load()
1049 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1055 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1084 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1088 BUG_ON(!journal); in ocfs2_journal_wipe()
1090 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1096 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1199 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1201 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1209 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1211 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1212 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1213 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1270 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1301 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1302 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1303 queue_work(ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1304 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1311 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1318 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1335 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1376 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1435 ocfs2_queue_recovery_completion(osb->journal, rm_quota[i], in __ocfs2_recovery_thread()
1541 journal_t *journal = NULL; in ocfs2_replay_journal() local
1610 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1611 if (journal == NULL) { in ocfs2_replay_journal()
1617 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1622 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1626 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1629 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1630 status = jbd2_journal_flush(journal); in ocfs2_replay_journal()
1631 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1653 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1728 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
1918 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2246 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2253 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2256 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2275 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2279 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()