checkpoint.c (a9419b63bf414775e8aeee95d8c4a5e0df690748) | checkpoint.c (b702c83e2eaa2fa2d72e957c55c0321535cc8b9f) |
---|---|
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> --- 1288 unchanged lines hidden (view full) --- 1297 1298static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) 1299{ 1300 unsigned long orphan_num = sbi->im[ORPHAN_INO].ino_num; 1301 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); 1302 unsigned long flags; 1303 1304 if (cpc->reason & CP_UMOUNT) { | 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> --- 1288 unchanged lines hidden (view full) --- 1297 1298static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc) 1299{ 1300 unsigned long orphan_num = sbi->im[ORPHAN_INO].ino_num; 1301 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); 1302 unsigned long flags; 1303 1304 if (cpc->reason & CP_UMOUNT) { |
1305 if (le32_to_cpu(ckpt->cp_pack_total_block_count) > 1306 sbi->blocks_per_seg - NM_I(sbi)->nat_bits_blocks) { | 1305 if (le32_to_cpu(ckpt->cp_pack_total_block_count) + 1306 NM_I(sbi)->nat_bits_blocks > sbi->blocks_per_seg) { |
1307 clear_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1308 f2fs_notice(sbi, "Disable nat_bits due to no space"); 1309 } else if (!is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG) && 1310 f2fs_nat_bitmap_enabled(sbi)) { 1311 f2fs_enable_nat_bits(sbi); 1312 set_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1313 f2fs_notice(sbi, "Rebuild and enable nat_bits"); 1314 } --- 598 unchanged lines hidden --- | 1307 clear_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1308 f2fs_notice(sbi, "Disable nat_bits due to no space"); 1309 } else if (!is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG) && 1310 f2fs_nat_bitmap_enabled(sbi)) { 1311 f2fs_enable_nat_bits(sbi); 1312 set_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1313 f2fs_notice(sbi, "Rebuild and enable nat_bits"); 1314 } --- 598 unchanged lines hidden --- |