commit.c (70d1b1a7f8b32b78c09b30dbcfa25ba1e470568b) | commit.c (f3ed5df398e8bc5b5e38f2db9b6494997e5ada49) |
---|---|
1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * linux/fs/jbd2/commit.c 4 * 5 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 6 * 7 * Copyright 1998 Red Hat corp --- All Rights Reserved 8 * --- 108 unchanged lines hidden (view full) --- 117 */ 118static int journal_submit_commit_record(journal_t *journal, 119 transaction_t *commit_transaction, 120 struct buffer_head **cbh, 121 __u32 crc32_sum) 122{ 123 struct commit_header *tmp; 124 struct buffer_head *bh; | 1// SPDX-License-Identifier: GPL-2.0+ 2/* 3 * linux/fs/jbd2/commit.c 4 * 5 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 6 * 7 * Copyright 1998 Red Hat corp --- All Rights Reserved 8 * --- 108 unchanged lines hidden (view full) --- 117 */ 118static int journal_submit_commit_record(journal_t *journal, 119 transaction_t *commit_transaction, 120 struct buffer_head **cbh, 121 __u32 crc32_sum) 122{ 123 struct commit_header *tmp; 124 struct buffer_head *bh; |
125 int ret; | |
126 struct timespec64 now; | 125 struct timespec64 now; |
126 blk_opf_t write_flags = REQ_OP_WRITE | REQ_SYNC; |
|
127 128 *cbh = NULL; 129 130 if (is_journal_aborted(journal)) 131 return 0; 132 133 bh = jbd2_journal_get_descriptor_buffer(commit_transaction, 134 JBD2_COMMIT_BLOCK); --- 15 unchanged lines hidden (view full) --- 150 BUFFER_TRACE(bh, "submit commit block"); 151 lock_buffer(bh); 152 clear_buffer_dirty(bh); 153 set_buffer_uptodate(bh); 154 bh->b_end_io = journal_end_buffer_io_sync; 155 156 if (journal->j_flags & JBD2_BARRIER && 157 !jbd2_has_feature_async_commit(journal)) | 127 128 *cbh = NULL; 129 130 if (is_journal_aborted(journal)) 131 return 0; 132 133 bh = jbd2_journal_get_descriptor_buffer(commit_transaction, 134 JBD2_COMMIT_BLOCK); --- 15 unchanged lines hidden (view full) --- 150 BUFFER_TRACE(bh, "submit commit block"); 151 lock_buffer(bh); 152 clear_buffer_dirty(bh); 153 set_buffer_uptodate(bh); 154 bh->b_end_io = journal_end_buffer_io_sync; 155 156 if (journal->j_flags & JBD2_BARRIER && 157 !jbd2_has_feature_async_commit(journal)) |
158 ret = submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | 159 REQ_FUA, bh); 160 else 161 ret = submit_bh(REQ_OP_WRITE | REQ_SYNC, bh); | 158 write_flags |= REQ_PREFLUSH | REQ_FUA; |
162 | 159 |
160 submit_bh(write_flags, bh); |
|
163 *cbh = bh; | 161 *cbh = bh; |
164 return ret; | 162 return 0; |
165} 166 167/* 168 * This function along with journal_submit_commit_record 169 * allows to write the commit record asynchronously. 170 */ 171static int journal_wait_on_commit_record(journal_t *journal, 172 struct buffer_head *bh) --- 1030 unchanged lines hidden --- | 163} 164 165/* 166 * This function along with journal_submit_commit_record 167 * allows to write the commit record asynchronously. 168 */ 169static int journal_wait_on_commit_record(journal_t *journal, 170 struct buffer_head *bh) --- 1030 unchanged lines hidden --- |