Lines Matching refs:journal

63 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
156 ocfs2_queue_recovery_completion(osb->journal, i, NULL, in ocfs2_queue_replay_slots()
298 struct ocfs2_journal *journal = NULL; in ocfs2_commit_cache() local
300 journal = osb->journal; in ocfs2_commit_cache()
303 down_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
305 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
308 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
312 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_commit_cache()
313 status = jbd2_journal_flush(journal->j_journal); in ocfs2_commit_cache()
314 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_commit_cache()
316 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
321 ocfs2_inc_trans_id(journal); in ocfs2_commit_cache()
323 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache()
324 atomic_set(&journal->j_num_trans, 0); in ocfs2_commit_cache()
325 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache()
327 trace_ocfs2_commit_cache_end(journal->j_trans_id, flushed); in ocfs2_commit_cache()
330 wake_up(&journal->j_checkpointed); in ocfs2_commit_cache()
337 journal_t *journal = osb->journal->j_journal; in ocfs2_start_trans() local
340 BUG_ON(!osb || !osb->journal->j_journal); in ocfs2_start_trans()
345 BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE); in ocfs2_start_trans()
350 return jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
354 down_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
356 handle = jbd2_journal_start(journal, max_buffs); in ocfs2_start_trans()
358 up_read(&osb->journal->j_trans_barrier); in ocfs2_start_trans()
363 if (is_journal_aborted(journal)) { in ocfs2_start_trans()
369 atomic_inc(&(osb->journal->j_num_trans)); in ocfs2_start_trans()
379 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_trans() local
389 up_read(&journal->j_trans_barrier); in ocfs2_commit_trans()
684 ocfs2_set_ci_lock_trans(osb->journal, ci); in __ocfs2_journal_access()
783 journal_t *journal = handle->h_transaction->t_journal; in ocfs2_journal_dirty() local
790 jbd2_journal_abort(journal, status); in ocfs2_journal_dirty()
800 journal_t *journal = osb->journal->j_journal; in ocfs2_set_journal_params() local
806 write_lock(&journal->j_state_lock); in ocfs2_set_journal_params()
807 journal->j_commit_interval = commit_interval; in ocfs2_set_journal_params()
809 journal->j_flags |= JBD2_BARRIER; in ocfs2_set_journal_params()
811 journal->j_flags &= ~JBD2_BARRIER; in ocfs2_set_journal_params()
812 write_unlock(&journal->j_state_lock); in ocfs2_set_journal_params()
815 int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty) in ocfs2_journal_init() argument
825 BUG_ON(!journal); in ocfs2_journal_init()
827 osb = journal->j_osb; in ocfs2_journal_init()
885 journal->j_journal = j_journal; in ocfs2_journal_init()
886 journal->j_journal->j_submit_inode_data_buffers = in ocfs2_journal_init()
888 journal->j_journal->j_finish_inode_data_buffers = in ocfs2_journal_init()
890 journal->j_inode = inode; in ocfs2_journal_init()
891 journal->j_bh = bh; in ocfs2_journal_init()
895 journal->j_state = OCFS2_JOURNAL_LOADED; in ocfs2_journal_init()
927 struct ocfs2_journal *journal = osb->journal; in ocfs2_journal_toggle_dirty() local
928 struct buffer_head *bh = journal->j_bh; in ocfs2_journal_toggle_dirty()
949 status = ocfs2_write_block(osb, bh, INODE_CACHE(journal->j_inode)); in ocfs2_journal_toggle_dirty()
962 struct ocfs2_journal *journal = NULL; in ocfs2_journal_shutdown() local
969 journal = osb->journal; in ocfs2_journal_shutdown()
970 if (!journal) in ocfs2_journal_shutdown()
973 inode = journal->j_inode; in ocfs2_journal_shutdown()
975 if (journal->j_state != OCFS2_JOURNAL_LOADED) in ocfs2_journal_shutdown()
982 num_running_trans = atomic_read(&(osb->journal->j_num_trans)); in ocfs2_journal_shutdown()
989 journal->j_state = OCFS2_JOURNAL_IN_SHUTDOWN; in ocfs2_journal_shutdown()
1001 BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0); in ocfs2_journal_shutdown()
1004 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1005 status = jbd2_journal_flush(journal->j_journal); in ocfs2_journal_shutdown()
1006 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_shutdown()
1012 if (!jbd2_journal_destroy(journal->j_journal) && !status) { in ocfs2_journal_shutdown()
1021 journal->j_journal = NULL; in ocfs2_journal_shutdown()
1028 brelse(journal->j_bh); in ocfs2_journal_shutdown()
1029 journal->j_bh = NULL; in ocfs2_journal_shutdown()
1031 journal->j_state = OCFS2_JOURNAL_FREE; in ocfs2_journal_shutdown()
1039 journal_t *journal, in ocfs2_clear_journal_error() argument
1044 olderr = jbd2_journal_errno(journal); in ocfs2_clear_journal_error()
1051 jbd2_journal_ack_err(journal); in ocfs2_clear_journal_error()
1052 jbd2_journal_clear_err(journal); in ocfs2_clear_journal_error()
1056 int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed) in ocfs2_journal_load() argument
1061 BUG_ON(!journal); in ocfs2_journal_load()
1063 osb = journal->j_osb; in ocfs2_journal_load()
1065 status = jbd2_journal_load(journal->j_journal); in ocfs2_journal_load()
1071 ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num); in ocfs2_journal_load()
1074 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_journal_load()
1075 status = jbd2_journal_flush(journal->j_journal); in ocfs2_journal_load()
1076 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_journal_load()
1108 int ocfs2_journal_wipe(struct ocfs2_journal *journal, int full) in ocfs2_journal_wipe() argument
1112 BUG_ON(!journal); in ocfs2_journal_wipe()
1114 status = jbd2_journal_wipe(journal->j_journal, full); in ocfs2_journal_wipe()
1120 status = ocfs2_journal_toggle_dirty(journal->j_osb, 0, 0); in ocfs2_journal_wipe()
1224 struct ocfs2_journal *journal = in ocfs2_complete_recovery() local
1226 struct ocfs2_super *osb = journal->j_osb; in ocfs2_complete_recovery()
1234 (unsigned long long)OCFS2_I(journal->j_inode)->ip_blkno); in ocfs2_complete_recovery()
1236 spin_lock(&journal->j_lock); in ocfs2_complete_recovery()
1237 list_splice_init(&journal->j_la_cleanups, &tmp_la_list); in ocfs2_complete_recovery()
1238 spin_unlock(&journal->j_lock); in ocfs2_complete_recovery()
1295 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, in ocfs2_queue_recovery_completion() argument
1326 spin_lock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1327 list_add_tail(&item->lri_list, &journal->j_la_cleanups); in ocfs2_queue_recovery_completion()
1328 queue_work(journal->j_osb->ocfs2_wq, &journal->j_recovery_work); in ocfs2_queue_recovery_completion()
1329 spin_unlock(&journal->j_lock); in ocfs2_queue_recovery_completion()
1336 struct ocfs2_journal *journal = osb->journal; in ocfs2_complete_mount_recovery() local
1343 ocfs2_queue_recovery_completion(journal, osb->slot_num, in ocfs2_complete_mount_recovery()
1359 ocfs2_queue_recovery_completion(osb->journal, in ocfs2_complete_quota_recovery()
1408 ocfs2_queue_recovery_completion(osb->journal, osb->slot_num, NULL, in __ocfs2_recovery_thread()
1473 ocfs2_queue_recovery_completion(osb->journal, in __ocfs2_recovery_thread()
1582 journal_t *journal = NULL; in ocfs2_replay_journal() local
1651 journal = jbd2_journal_init_inode(inode); in ocfs2_replay_journal()
1652 if (journal == NULL) { in ocfs2_replay_journal()
1658 status = jbd2_journal_load(journal); in ocfs2_replay_journal()
1663 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1667 ocfs2_clear_journal_error(osb->sb, journal, slot_num); in ocfs2_replay_journal()
1670 jbd2_journal_lock_updates(journal); in ocfs2_replay_journal()
1671 status = jbd2_journal_flush(journal); in ocfs2_replay_journal()
1672 jbd2_journal_unlock_updates(journal); in ocfs2_replay_journal()
1694 jbd2_journal_destroy(journal); in ocfs2_replay_journal()
1767 ocfs2_queue_recovery_completion(osb->journal, slot_num, la_copy, in ocfs2_recover_node()
1956 ocfs2_queue_recovery_completion(osb->journal, i, NULL, NULL, in ocfs2_queue_orphan_scan()
2298 struct ocfs2_journal *journal = osb->journal; in ocfs2_commit_thread() local
2305 atomic_read(&journal->j_num_trans) == 0)) { in ocfs2_commit_thread()
2308 atomic_read(&journal->j_num_trans) in ocfs2_commit_thread()
2327 if (kthread_should_stop() && atomic_read(&journal->j_num_trans)){ in ocfs2_commit_thread()
2331 atomic_read(&journal->j_num_trans)); in ocfs2_commit_thread()