• 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
213 static int journal_submit_data_buffers(journal_t *journal, in journal_submit_data_buffers() argument
220 spin_lock(&journal->j_list_lock); in journal_submit_data_buffers()
229 spin_unlock(&journal->j_list_lock); in journal_submit_data_buffers()
241 spin_lock(&journal->j_list_lock); in journal_submit_data_buffers()
247 spin_unlock(&journal->j_list_lock); in journal_submit_data_buffers()
256 static int journal_finish_inode_data_buffers(journal_t *journal, in journal_finish_inode_data_buffers() argument
263 spin_lock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
271 spin_unlock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
277 spin_lock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
298 spin_unlock(&journal->j_list_lock); in journal_finish_inode_data_buffers()
355 void jbd2_journal_commit_transaction(journal_t *journal) in jbd2_journal_commit_transaction() argument
361 struct buffer_head **wbuf = journal->j_wbuf; in jbd2_journal_commit_transaction()
374 int tag_bytes = journal_tag_bytes(journal); in jbd2_journal_commit_transaction()
386 if (jbd2_journal_has_csum_v2or3(journal)) in jbd2_journal_commit_transaction()
395 if (journal->j_flags & JBD2_FLUSHED) { in jbd2_journal_commit_transaction()
397 mutex_lock_io(&journal->j_checkpoint_mutex); in jbd2_journal_commit_transaction()
404 jbd2_journal_update_sb_log_tail(journal, in jbd2_journal_commit_transaction()
405 journal->j_tail_sequence, in jbd2_journal_commit_transaction()
406 journal->j_tail, in jbd2_journal_commit_transaction()
408 mutex_unlock(&journal->j_checkpoint_mutex); in jbd2_journal_commit_transaction()
413 J_ASSERT(journal->j_running_transaction != NULL); in jbd2_journal_commit_transaction()
414 J_ASSERT(journal->j_committing_transaction == NULL); in jbd2_journal_commit_transaction()
416 commit_transaction = journal->j_running_transaction; in jbd2_journal_commit_transaction()
418 trace_jbd2_start_commit(journal, commit_transaction); in jbd2_journal_commit_transaction()
422 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
426 trace_jbd2_commit_locking(journal, commit_transaction); in jbd2_journal_commit_transaction()
441 prepare_to_wait(&journal->j_wait_updates, &wait, in jbd2_journal_commit_transaction()
445 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
447 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
450 finish_wait(&journal->j_wait_updates, &wait); in jbd2_journal_commit_transaction()
456 journal->j_max_transaction_buffers); in jbd2_journal_commit_transaction()
491 jbd2_journal_refile_buffer(journal, jh); in jbd2_journal_commit_transaction()
494 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
500 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
501 __jbd2_journal_clean_checkpoint_list(journal, false); in jbd2_journal_commit_transaction()
502 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
510 jbd2_clear_buffer_revoked_flags(journal); in jbd2_journal_commit_transaction()
515 jbd2_journal_switch_revoke_table(journal); in jbd2_journal_commit_transaction()
517 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
521 atomic_sub(atomic_read(&journal->j_reserved_credits), in jbd2_journal_commit_transaction()
524 trace_jbd2_commit_flushing(journal, commit_transaction); in jbd2_journal_commit_transaction()
530 journal->j_committing_transaction = commit_transaction; in jbd2_journal_commit_transaction()
531 journal->j_running_transaction = NULL; in jbd2_journal_commit_transaction()
533 commit_transaction->t_log_start = journal->j_head; in jbd2_journal_commit_transaction()
534 wake_up_all(&journal->j_wait_transaction_locked); in jbd2_journal_commit_transaction()
535 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
543 err = journal_submit_data_buffers(journal, commit_transaction); in jbd2_journal_commit_transaction()
545 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
557 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
559 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
561 trace_jbd2_commit_logging(journal, commit_transaction); in jbd2_journal_commit_transaction()
584 if (is_journal_aborted(journal)) { in jbd2_journal_commit_transaction()
591 jbd2_journal_refile_buffer(journal, jh); in jbd2_journal_commit_transaction()
613 jbd2_journal_abort(journal, -EIO); in jbd2_journal_commit_transaction()
636 err = jbd2_journal_next_log_block(journal, &blocknr); in jbd2_journal_commit_transaction()
641 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
666 jbd2_journal_abort(journal, flags); in jbd2_journal_commit_transaction()
681 write_tag_block(journal, tag, jh2bh(jh)->b_blocknr); in jbd2_journal_commit_transaction()
683 jbd2_block_tag_csum_set(journal, tag, wbuf[bufs], in jbd2_journal_commit_transaction()
690 memcpy (tagp, journal->j_uuid, 16); in jbd2_journal_commit_transaction()
699 if (bufs == journal->j_wbufsize || in jbd2_journal_commit_transaction()
712 jbd2_descriptor_block_csum_set(journal, in jbd2_journal_commit_transaction()
720 if (jbd2_has_feature_checksum(journal)) { in jbd2_journal_commit_transaction()
740 err = journal_finish_inode_data_buffers(journal, commit_transaction); in jbd2_journal_commit_transaction()
744 "on %s\n", journal->j_devname); in jbd2_journal_commit_transaction()
745 if (journal->j_flags & JBD2_ABORT_ON_SYNCDATA_ERR) in jbd2_journal_commit_transaction()
746 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
758 jbd2_journal_get_log_tail(journal, &first_tid, &first_block); in jbd2_journal_commit_transaction()
760 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
762 long freed = first_block - journal->j_tail; in jbd2_journal_commit_transaction()
764 if (first_block < journal->j_tail) in jbd2_journal_commit_transaction()
765 freed += journal->j_last - journal->j_first; in jbd2_journal_commit_transaction()
767 if (freed < journal->j_maxlen / 4) in jbd2_journal_commit_transaction()
772 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
780 (journal->j_fs_dev != journal->j_dev) && in jbd2_journal_commit_transaction()
781 (journal->j_flags & JBD2_BARRIER)) in jbd2_journal_commit_transaction()
782 blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL); in jbd2_journal_commit_transaction()
785 if (jbd2_has_feature_async_commit(journal)) { in jbd2_journal_commit_transaction()
786 err = journal_submit_commit_record(journal, commit_transaction, in jbd2_journal_commit_transaction()
789 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
870 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
873 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
876 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
878 if (!jbd2_has_feature_async_commit(journal)) { in jbd2_journal_commit_transaction()
879 err = journal_submit_commit_record(journal, commit_transaction, in jbd2_journal_commit_transaction()
882 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
885 err = journal_wait_on_commit_record(journal, cbh); in jbd2_journal_commit_transaction()
887 if (jbd2_has_feature_async_commit(journal) && in jbd2_journal_commit_transaction()
888 journal->j_flags & JBD2_BARRIER) { in jbd2_journal_commit_transaction()
889 blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL); in jbd2_journal_commit_transaction()
893 jbd2_journal_abort(journal, err); in jbd2_journal_commit_transaction()
901 jbd2_update_log_tail(journal, first_tid, first_block); in jbd2_journal_commit_transaction()
920 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
927 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
964 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1017 if (is_journal_aborted(journal)) in jbd2_journal_commit_transaction()
1040 cond_resched_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1042 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1049 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1050 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1056 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1057 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1064 if (journal->j_checkpoint_transactions == NULL) { in jbd2_journal_commit_transaction()
1065 journal->j_checkpoint_transactions = commit_transaction; in jbd2_journal_commit_transaction()
1070 journal->j_checkpoint_transactions; in jbd2_journal_commit_transaction()
1078 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1096 trace_jbd2_run_stats(journal->j_fs_dev->bd_dev, in jbd2_journal_commit_transaction()
1101 J_ASSERT(commit_transaction == journal->j_committing_transaction); in jbd2_journal_commit_transaction()
1102 journal->j_commit_sequence = commit_transaction->t_tid; in jbd2_journal_commit_transaction()
1103 journal->j_committing_transaction = NULL; in jbd2_journal_commit_transaction()
1110 if (likely(journal->j_average_commit_time)) in jbd2_journal_commit_transaction()
1111 journal->j_average_commit_time = (commit_time + in jbd2_journal_commit_transaction()
1112 journal->j_average_commit_time*3) / 4; in jbd2_journal_commit_transaction()
1114 journal->j_average_commit_time = commit_time; in jbd2_journal_commit_transaction()
1116 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1118 if (journal->j_commit_callback) in jbd2_journal_commit_transaction()
1119 journal->j_commit_callback(journal, commit_transaction); in jbd2_journal_commit_transaction()
1121 trace_jbd2_end_commit(journal, commit_transaction); in jbd2_journal_commit_transaction()
1123 journal->j_commit_sequence, journal->j_tail_sequence); in jbd2_journal_commit_transaction()
1125 write_lock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1126 spin_lock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1131 __jbd2_journal_drop_transaction(journal, commit_transaction); in jbd2_journal_commit_transaction()
1134 spin_unlock(&journal->j_list_lock); in jbd2_journal_commit_transaction()
1135 write_unlock(&journal->j_state_lock); in jbd2_journal_commit_transaction()
1136 wake_up(&journal->j_wait_done_commit); in jbd2_journal_commit_transaction()
1141 spin_lock(&journal->j_history_lock); in jbd2_journal_commit_transaction()
1142 journal->j_stats.ts_tid++; in jbd2_journal_commit_transaction()
1143 journal->j_stats.ts_requested += stats.ts_requested; in jbd2_journal_commit_transaction()
1144 journal->j_stats.run.rs_wait += stats.run.rs_wait; in jbd2_journal_commit_transaction()
1145 journal->j_stats.run.rs_request_delay += stats.run.rs_request_delay; in jbd2_journal_commit_transaction()
1146 journal->j_stats.run.rs_running += stats.run.rs_running; in jbd2_journal_commit_transaction()
1147 journal->j_stats.run.rs_locked += stats.run.rs_locked; in jbd2_journal_commit_transaction()
1148 journal->j_stats.run.rs_flushing += stats.run.rs_flushing; in jbd2_journal_commit_transaction()
1149 journal->j_stats.run.rs_logging += stats.run.rs_logging; in jbd2_journal_commit_transaction()
1150 journal->j_stats.run.rs_handle_count += stats.run.rs_handle_count; in jbd2_journal_commit_transaction()
1151 journal->j_stats.run.rs_blocks += stats.run.rs_blocks; in jbd2_journal_commit_transaction()
1152 journal->j_stats.run.rs_blocks_logged += stats.run.rs_blocks_logged; in jbd2_journal_commit_transaction()
1153 spin_unlock(&journal->j_history_lock); in jbd2_journal_commit_transaction()