hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/fs/ocfs2/journal.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* -*- mode: c; c-basic-offset: 8; -*-
23 * vim: noexpandtab sw=8 ts=8 sts=0:
34 *
....@@ -6,21 +7,6 @@
67 * Defines functions of journalling api
78 *
89 * Copyright (C) 2003, 2004 Oracle. All rights reserved.
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2 of the License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public
21
- * License along with this program; if not, write to the
22
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
- * Boston, MA 021110-1307, USA.
2410 */
2511
2612 #include <linux/fs.h>
....@@ -105,7 +91,7 @@
10591 struct ocfs2_replay_map {
10692 unsigned int rm_slots;
10793 enum ocfs2_replay_state rm_state;
108
- unsigned char rm_replay_slots[0];
94
+ unsigned char rm_replay_slots[];
10995 };
11096
11197 static void ocfs2_replay_map_set_state(struct ocfs2_super *osb, int state)
....@@ -173,7 +159,7 @@
173159 replay_map->rm_state = REPLAY_DONE;
174160 }
175161
176
-static void ocfs2_free_replay_slots(struct ocfs2_super *osb)
162
+void ocfs2_free_replay_slots(struct ocfs2_super *osb)
177163 {
178164 struct ocfs2_replay_map *replay_map = osb->replay_map;
179165
....@@ -434,14 +420,14 @@
434420 if (!nblocks)
435421 return 0;
436422
437
- old_nblocks = handle->h_buffer_credits;
423
+ old_nblocks = jbd2_handle_buffer_credits(handle);
438424
439425 trace_ocfs2_extend_trans(old_nblocks, nblocks);
440426
441427 #ifdef CONFIG_OCFS2_DEBUG_FS
442428 status = 1;
443429 #else
444
- status = jbd2_journal_extend(handle, nblocks);
430
+ status = jbd2_journal_extend(handle, nblocks, 0);
445431 if (status < 0) {
446432 mlog_errno(status);
447433 goto bail;
....@@ -475,13 +461,13 @@
475461
476462 BUG_ON(!handle);
477463
478
- old_nblks = handle->h_buffer_credits;
464
+ old_nblks = jbd2_handle_buffer_credits(handle);
479465 trace_ocfs2_allocate_extend_trans(old_nblks, thresh);
480466
481467 if (old_nblks < thresh)
482468 return 0;
483469
484
- status = jbd2_journal_extend(handle, OCFS2_MAX_TRANS_DATA);
470
+ status = jbd2_journal_extend(handle, OCFS2_MAX_TRANS_DATA, 0);
485471 if (status < 0) {
486472 mlog_errno(status);
487473 goto bail;
....@@ -891,12 +877,16 @@
891877 goto done;
892878 }
893879
894
- trace_ocfs2_journal_init_maxlen(j_journal->j_maxlen);
880
+ trace_ocfs2_journal_init_maxlen(j_journal->j_total_len);
895881
896882 *dirty = (le32_to_cpu(di->id1.journal1.ij_flags) &
897883 OCFS2_JOURNAL_DIRTY_FL);
898884
899885 journal->j_journal = j_journal;
886
+ journal->j_journal->j_submit_inode_data_buffers =
887
+ jbd2_journal_submit_inode_data_buffers;
888
+ journal->j_journal->j_finish_inode_data_buffers =
889
+ jbd2_journal_finish_inode_data_buffers;
900890 journal->j_inode = inode;
901891 journal->j_bh = bh;
902892