| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* -*- mode: c; c-basic-offset: 8; -*- |
|---|
| 2 | 3 | * vim: noexpandtab sw=8 ts=8 sts=0: |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Defines functions of journalling api |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * 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. |
|---|
| 24 | 10 | */ |
|---|
| 25 | 11 | |
|---|
| 26 | 12 | #include <linux/fs.h> |
|---|
| .. | .. |
|---|
| 105 | 91 | struct ocfs2_replay_map { |
|---|
| 106 | 92 | unsigned int rm_slots; |
|---|
| 107 | 93 | enum ocfs2_replay_state rm_state; |
|---|
| 108 | | - unsigned char rm_replay_slots[0]; |
|---|
| 94 | + unsigned char rm_replay_slots[]; |
|---|
| 109 | 95 | }; |
|---|
| 110 | 96 | |
|---|
| 111 | 97 | static void ocfs2_replay_map_set_state(struct ocfs2_super *osb, int state) |
|---|
| .. | .. |
|---|
| 173 | 159 | replay_map->rm_state = REPLAY_DONE; |
|---|
| 174 | 160 | } |
|---|
| 175 | 161 | |
|---|
| 176 | | -static void ocfs2_free_replay_slots(struct ocfs2_super *osb) |
|---|
| 162 | +void ocfs2_free_replay_slots(struct ocfs2_super *osb) |
|---|
| 177 | 163 | { |
|---|
| 178 | 164 | struct ocfs2_replay_map *replay_map = osb->replay_map; |
|---|
| 179 | 165 | |
|---|
| .. | .. |
|---|
| 434 | 420 | if (!nblocks) |
|---|
| 435 | 421 | return 0; |
|---|
| 436 | 422 | |
|---|
| 437 | | - old_nblocks = handle->h_buffer_credits; |
|---|
| 423 | + old_nblocks = jbd2_handle_buffer_credits(handle); |
|---|
| 438 | 424 | |
|---|
| 439 | 425 | trace_ocfs2_extend_trans(old_nblocks, nblocks); |
|---|
| 440 | 426 | |
|---|
| 441 | 427 | #ifdef CONFIG_OCFS2_DEBUG_FS |
|---|
| 442 | 428 | status = 1; |
|---|
| 443 | 429 | #else |
|---|
| 444 | | - status = jbd2_journal_extend(handle, nblocks); |
|---|
| 430 | + status = jbd2_journal_extend(handle, nblocks, 0); |
|---|
| 445 | 431 | if (status < 0) { |
|---|
| 446 | 432 | mlog_errno(status); |
|---|
| 447 | 433 | goto bail; |
|---|
| .. | .. |
|---|
| 475 | 461 | |
|---|
| 476 | 462 | BUG_ON(!handle); |
|---|
| 477 | 463 | |
|---|
| 478 | | - old_nblks = handle->h_buffer_credits; |
|---|
| 464 | + old_nblks = jbd2_handle_buffer_credits(handle); |
|---|
| 479 | 465 | trace_ocfs2_allocate_extend_trans(old_nblks, thresh); |
|---|
| 480 | 466 | |
|---|
| 481 | 467 | if (old_nblks < thresh) |
|---|
| 482 | 468 | return 0; |
|---|
| 483 | 469 | |
|---|
| 484 | | - status = jbd2_journal_extend(handle, OCFS2_MAX_TRANS_DATA); |
|---|
| 470 | + status = jbd2_journal_extend(handle, OCFS2_MAX_TRANS_DATA, 0); |
|---|
| 485 | 471 | if (status < 0) { |
|---|
| 486 | 472 | mlog_errno(status); |
|---|
| 487 | 473 | goto bail; |
|---|
| .. | .. |
|---|
| 891 | 877 | goto done; |
|---|
| 892 | 878 | } |
|---|
| 893 | 879 | |
|---|
| 894 | | - trace_ocfs2_journal_init_maxlen(j_journal->j_maxlen); |
|---|
| 880 | + trace_ocfs2_journal_init_maxlen(j_journal->j_total_len); |
|---|
| 895 | 881 | |
|---|
| 896 | 882 | *dirty = (le32_to_cpu(di->id1.journal1.ij_flags) & |
|---|
| 897 | 883 | OCFS2_JOURNAL_DIRTY_FL); |
|---|
| 898 | 884 | |
|---|
| 899 | 885 | 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; |
|---|
| 900 | 890 | journal->j_inode = inode; |
|---|
| 901 | 891 | journal->j_bh = bh; |
|---|
| 902 | 892 | |
|---|