checkpoint.c (b181f7029bd71238ac2754ce7052dffd69432085) checkpoint.c (fbcd51e0d977ae5e50243022434a17621ca892e9)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/checkpoint.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 1156 unchanged lines hidden (view full) ---

1165 struct f2fs_nm_info *nm_i = NM_I(sbi);
1166 nid_t last_nid = nm_i->next_scan_nid;
1167
1168 next_free_nid(sbi, &last_nid);
1169 ckpt->valid_block_count = cpu_to_le64(valid_user_blocks(sbi));
1170 ckpt->valid_node_count = cpu_to_le32(valid_node_count(sbi));
1171 ckpt->valid_inode_count = cpu_to_le32(valid_inode_count(sbi));
1172 ckpt->next_free_nid = cpu_to_le32(last_nid);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/checkpoint.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/fs.h>

--- 1156 unchanged lines hidden (view full) ---

1165 struct f2fs_nm_info *nm_i = NM_I(sbi);
1166 nid_t last_nid = nm_i->next_scan_nid;
1167
1168 next_free_nid(sbi, &last_nid);
1169 ckpt->valid_block_count = cpu_to_le64(valid_user_blocks(sbi));
1170 ckpt->valid_node_count = cpu_to_le32(valid_node_count(sbi));
1171 ckpt->valid_inode_count = cpu_to_le32(valid_inode_count(sbi));
1172 ckpt->next_free_nid = cpu_to_le32(last_nid);
1173
1174 /* update user_block_counts */
1175 sbi->last_valid_block_count = sbi->total_valid_block_count;
1176 percpu_counter_set(&sbi->alloc_valid_block_count, 0);
1177 percpu_counter_set(&sbi->rf_node_block_count, 0);
1173}
1174
1175static bool __need_flush_quota(struct f2fs_sb_info *sbi)
1176{
1177 bool ret = false;
1178
1179 if (!is_journalled_quota(sbi))
1180 return false;

--- 373 unchanged lines hidden (view full) ---

1554 sbi->sectors_written_start) >> 1;
1555 seg_i->journal->info.kbytes_written = cpu_to_le64(kbytes_written);
1556
1557 if (__remain_node_summaries(cpc->reason)) {
1558 f2fs_write_node_summaries(sbi, start_blk);
1559 start_blk += NR_CURSEG_NODE_TYPE;
1560 }
1561
1178}
1179
1180static bool __need_flush_quota(struct f2fs_sb_info *sbi)
1181{
1182 bool ret = false;
1183
1184 if (!is_journalled_quota(sbi))
1185 return false;

--- 373 unchanged lines hidden (view full) ---

1559 sbi->sectors_written_start) >> 1;
1560 seg_i->journal->info.kbytes_written = cpu_to_le64(kbytes_written);
1561
1562 if (__remain_node_summaries(cpc->reason)) {
1563 f2fs_write_node_summaries(sbi, start_blk);
1564 start_blk += NR_CURSEG_NODE_TYPE;
1565 }
1566
1562 /* update user_block_counts */
1563 sbi->last_valid_block_count = sbi->total_valid_block_count;
1564 percpu_counter_set(&sbi->alloc_valid_block_count, 0);
1565 percpu_counter_set(&sbi->rf_node_block_count, 0);
1566
1567 /* Here, we have one bio having CP pack except cp pack 2 page */
1568 f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
1569 /* Wait for all dirty meta pages to be submitted for IO */
1570 f2fs_wait_on_all_pages(sbi, F2FS_DIRTY_META);
1571
1572 /* wait for previous submitted meta pages writeback */
1573 f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA);
1574

--- 373 unchanged lines hidden ---
1567 /* Here, we have one bio having CP pack except cp pack 2 page */
1568 f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
1569 /* Wait for all dirty meta pages to be submitted for IO */
1570 f2fs_wait_on_all_pages(sbi, F2FS_DIRTY_META);
1571
1572 /* wait for previous submitted meta pages writeback */
1573 f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA);
1574

--- 373 unchanged lines hidden ---