• Home
  • Raw
  • Download

Lines Matching refs:journal

116 static int journal_submit_commit_record(journal_t *journal,  in journal_submit_commit_record()  argument
128 if (is_journal_aborted(journal)) in journal_submit_commit_record()
141 if (jbd2_has_feature_checksum(journal)) { in journal_submit_commit_record()
146 jbd2_commit_block_csum_set(journal, bh); in journal_submit_commit_record()
154 if (journal->j_flags & JBD2_BARRIER && in journal_submit_commit_record()
155 !jbd2_has_feature_async_commit(journal)) in journal_submit_commit_record()
169 static int journal_wait_on_commit_record(journal_t *journal, in journal_wait_on_commit_record() argument
222 int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode) in jbd2_wait_inode_data() argument
241 static int journal_submit_data_buffers(journal_t *journal, in journal_submit_data_buffers() argument
247 spin_lock(&journal->j_list_lock); in journal_submit_data_buffers()
252 spin_unlock(&journal->j_list_lock); in journal_submit_data_buffers()
255 if (journal->j_submit_inode_data_buffers) { in journal_submit_data_buffers()
256 err = journal->j_submit_inode_data_buffers(jinode); in journal_submit_data_buffers()
260 spin_lock(&journal->j_list_lock); in journal_submit_data_buffers()
266 spin_unlock(&journal->j_list_lock); in journal_submit_data_buffers()
284 static int journal_finish_inode_data_buffers(journal_t *journal, in journal_finish_inode_data_buffers() argument
291 spin_lock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
296 spin_unlock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
298 if (journal->j_finish_inode_data_buffers) { in journal_finish_inode_data_buffers()
299 err = journal->j_finish_inode_data_buffers(jinode); in journal_finish_inode_data_buffers()
304 spin_lock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
325 spin_unlock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
382 void jbd2_journal_commit_transaction(journal_t *journal) in jbd2_journal_commit_transaction() argument
388 struct buffer_head **wbuf = journal->j_wbuf; in jbd2_journal_commit_transaction()
401 int tag_bytes = journal_tag_bytes(journal); in jbd2_journal_commit_transaction()
413 if (jbd2_journal_has_csum_v2or3(journal)) in jbd2_journal_commit_transaction()
422 if (journal->j_flags & JBD2_FLUSHED) { in jbd2_journal_commit_transaction()
424 mutex_lock_io(&journal->j_checkpoint_mutex); in jbd2_journal_commit_transaction()
431 jbd2_journal_update_sb_log_tail(journal, in jbd2_journal_commit_transaction()
432 journal->j_tail_sequence, in jbd2_journal_commit_transaction()
433 journal->j_tail, in jbd2_journal_commit_transaction()
435 mutex_unlock(&journal->j_checkpoint_mutex); in jbd2_journal_commit_transaction()
440 J_ASSERT(journal->j_running_transaction != NULL); in jbd2_journal_commit_transaction()
441 J_ASSERT(journal->j_committing_transaction == NULL); in jbd2_journal_commit_transaction()
443 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
444 journal->j_flags |= JBD2_FULL_COMMIT_ONGOING; in jbd2_journal_commit_transaction()
445 while (journal->j_flags & JBD2_FAST_COMMIT_ONGOING) { in jbd2_journal_commit_transaction()
448 prepare_to_wait(&journal->j_fc_wait, &wait, in jbd2_journal_commit_transaction()
450 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
452 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
453 finish_wait(&journal->j_fc_wait, &wait); in jbd2_journal_commit_transaction()
464 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
466 commit_transaction = journal->j_running_transaction; in jbd2_journal_commit_transaction()
468 trace_jbd2_start_commit(journal, commit_transaction); in jbd2_journal_commit_transaction()
472 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
473 journal->j_fc_off = 0; in jbd2_journal_commit_transaction()
477 trace_jbd2_commit_locking(journal, commit_transaction); in jbd2_journal_commit_transaction()
489 jbd2_journal_wait_updates(journal); in jbd2_journal_commit_transaction()
494 journal->j_max_transaction_buffers); in jbd2_journal_commit_transaction()
529 jbd2_journal_refile_buffer(journal, jh); in jbd2_journal_commit_transaction()
532 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
538 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
539 __jbd2_journal_clean_checkpoint_list(journal, false); in jbd2_journal_commit_transaction()
540 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
548 jbd2_clear_buffer_revoked_flags(journal); in jbd2_journal_commit_transaction()
553 jbd2_journal_switch_revoke_table(journal); in jbd2_journal_commit_transaction()
555 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
559 atomic_sub(atomic_read(&journal->j_reserved_credits), in jbd2_journal_commit_transaction()
562 trace_jbd2_commit_flushing(journal, commit_transaction); in jbd2_journal_commit_transaction()
568 journal->j_committing_transaction = commit_transaction; in jbd2_journal_commit_transaction()
569 journal->j_running_transaction = NULL; in jbd2_journal_commit_transaction()
571 commit_transaction->t_log_start = journal->j_head; in jbd2_journal_commit_transaction()
572 wake_up_all(&journal->j_wait_transaction_locked); in jbd2_journal_commit_transaction()
573 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
581 err = journal_submit_data_buffers(journal, commit_transaction); in jbd2_journal_commit_transaction()
583 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
595 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
597 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
599 trace_jbd2_commit_logging(journal, commit_transaction); in jbd2_journal_commit_transaction()
621 if (is_journal_aborted(journal)) { in jbd2_journal_commit_transaction()
628 jbd2_journal_refile_buffer(journal, jh); in jbd2_journal_commit_transaction()
650 jbd2_journal_abort(journal, -EIO); in jbd2_journal_commit_transaction()
673 err = jbd2_journal_next_log_block(journal, &blocknr); in jbd2_journal_commit_transaction()
678 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
702 jbd2_journal_abort(journal, flags); in jbd2_journal_commit_transaction()
717 write_tag_block(journal, tag, jh2bh(jh)->b_blocknr); in jbd2_journal_commit_transaction()
719 jbd2_block_tag_csum_set(journal, tag, wbuf[bufs], in jbd2_journal_commit_transaction()
726 memcpy (tagp, journal->j_uuid, 16); in jbd2_journal_commit_transaction()
735 if (bufs == journal->j_wbufsize || in jbd2_journal_commit_transaction()
748 jbd2_descriptor_block_csum_set(journal, in jbd2_journal_commit_transaction()
756 if (jbd2_has_feature_checksum(journal)) { in jbd2_journal_commit_transaction()
776 err = journal_finish_inode_data_buffers(journal, commit_transaction); in jbd2_journal_commit_transaction()
780 "on %s\n", journal->j_devname); in jbd2_journal_commit_transaction()
781 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR) in jbd2_journal_commit_transaction()
782 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
794 jbd2_journal_get_log_tail(journal, &first_tid, &first_block); in jbd2_journal_commit_transaction()
796 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
798 long freed = first_block - journal->j_tail; in jbd2_journal_commit_transaction()
800 if (first_block < journal->j_tail) in jbd2_journal_commit_transaction()
801 freed += journal->j_last - journal->j_first; in jbd2_journal_commit_transaction()
803 if (freed < jbd2_journal_get_max_txn_bufs(journal)) in jbd2_journal_commit_transaction()
808 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
816 (journal->j_fs_dev != journal->j_dev) && in jbd2_journal_commit_transaction()
817 (journal->j_flags & JBD2_BARRIER)) in jbd2_journal_commit_transaction()
818 blkdev_issue_flush(journal->j_fs_dev); in jbd2_journal_commit_transaction()
821 if (jbd2_has_feature_async_commit(journal)) { in jbd2_journal_commit_transaction()
822 err = journal_submit_commit_record(journal, commit_transaction, in jbd2_journal_commit_transaction()
825 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
906 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
909 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
912 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
914 if (!jbd2_has_feature_async_commit(journal)) { in jbd2_journal_commit_transaction()
915 err = journal_submit_commit_record(journal, commit_transaction, in jbd2_journal_commit_transaction()
918 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
921 err = journal_wait_on_commit_record(journal, cbh); in jbd2_journal_commit_transaction()
923 if (jbd2_has_feature_async_commit(journal) && in jbd2_journal_commit_transaction()
924 journal->j_flags & JBD2_BARRIER) { in jbd2_journal_commit_transaction()
925 blkdev_issue_flush(journal->j_dev); in jbd2_journal_commit_transaction()
929 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
940 jbd2_update_log_tail(journal, first_tid, first_block); in jbd2_journal_commit_transaction()
959 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
967 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1004 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1057 if (is_journal_aborted(journal)) in jbd2_journal_commit_transaction()
1082 cond_resched_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1084 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1091 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1092 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1098 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1099 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1106 if (journal->j_checkpoint_transactions == NULL) { in jbd2_journal_commit_transaction()
1107 journal->j_checkpoint_transactions = commit_transaction; in jbd2_journal_commit_transaction()
1112 journal->j_checkpoint_transactions; in jbd2_journal_commit_transaction()
1120 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1138 trace_jbd2_run_stats(journal->j_fs_dev->bd_dev, in jbd2_journal_commit_transaction()
1143 J_ASSERT(commit_transaction == journal->j_committing_transaction); in jbd2_journal_commit_transaction()
1144 journal->j_commit_sequence = commit_transaction->t_tid; in jbd2_journal_commit_transaction()
1145 journal->j_committing_transaction = NULL; in jbd2_journal_commit_transaction()
1152 if (likely(journal->j_average_commit_time)) in jbd2_journal_commit_transaction()
1153 journal->j_average_commit_time = (commit_time + in jbd2_journal_commit_transaction()
1154 journal->j_average_commit_time*3) / 4; in jbd2_journal_commit_transaction()
1156 journal->j_average_commit_time = commit_time; in jbd2_journal_commit_transaction()
1158 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1160 if (journal->j_commit_callback) in jbd2_journal_commit_transaction()
1161 journal->j_commit_callback(journal, commit_transaction); in jbd2_journal_commit_transaction()
1162 if (journal->j_fc_cleanup_callback) in jbd2_journal_commit_transaction()
1163 journal->j_fc_cleanup_callback(journal, 1, commit_transaction->t_tid); in jbd2_journal_commit_transaction()
1165 trace_jbd2_end_commit(journal, commit_transaction); in jbd2_journal_commit_transaction()
1167 journal->j_commit_sequence, journal->j_tail_sequence); in jbd2_journal_commit_transaction()
1169 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1170 journal->j_flags &= ~JBD2_FULL_COMMIT_ONGOING; in jbd2_journal_commit_transaction()
1171 journal->j_flags &= ~JBD2_FAST_COMMIT_ONGOING; in jbd2_journal_commit_transaction()
1172 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1176 __jbd2_journal_drop_transaction(journal, commit_transaction); in jbd2_journal_commit_transaction()
1179 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1180 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1181 wake_up(&journal->j_wait_done_commit); in jbd2_journal_commit_transaction()
1182 wake_up(&journal->j_fc_wait); in jbd2_journal_commit_transaction()
1187 spin_lock(&journal->j_history_lock); in jbd2_journal_commit_transaction()
1188 journal->j_stats.ts_tid++; in jbd2_journal_commit_transaction()
1189 journal->j_stats.ts_requested += stats.ts_requested; in jbd2_journal_commit_transaction()
1190 journal->j_stats.run.rs_wait += stats.run.rs_wait; in jbd2_journal_commit_transaction()
1191 journal->j_stats.run.rs_request_delay += stats.run.rs_request_delay; in jbd2_journal_commit_transaction()
1192 journal->j_stats.run.rs_running += stats.run.rs_running; in jbd2_journal_commit_transaction()
1193 journal->j_stats.run.rs_locked += stats.run.rs_locked; in jbd2_journal_commit_transaction()
1194 journal->j_stats.run.rs_flushing += stats.run.rs_flushing; in jbd2_journal_commit_transaction()
1195 journal->j_stats.run.rs_logging += stats.run.rs_logging; in jbd2_journal_commit_transaction()
1196 journal->j_stats.run.rs_handle_count += stats.run.rs_handle_count; in jbd2_journal_commit_transaction()
1197 journal->j_stats.run.rs_blocks += stats.run.rs_blocks; in jbd2_journal_commit_transaction()
1198 journal->j_stats.run.rs_blocks_logged += stats.run.rs_blocks_logged; in jbd2_journal_commit_transaction()
1199 spin_unlock(&journal->j_history_lock); in jbd2_journal_commit_transaction()