f2fs.h (279d6df20c94079d35e012f1602d40c42632e8f3) | f2fs.h (c473f1a9658b6c23d576136d5a49b1c731ef1767) |
---|---|
1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 111 unchanged lines hidden (view full) --- 120/* 121 * For checkpoint manager 122 */ 123enum { 124 NAT_BITMAP, 125 SIT_BITMAP 126}; 127 | 1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 111 unchanged lines hidden (view full) --- 120/* 121 * For checkpoint manager 122 */ 123enum { 124 NAT_BITMAP, 125 SIT_BITMAP 126}; 127 |
128enum { 129 CP_UMOUNT, 130 CP_FASTBOOT, 131 CP_SYNC, 132 CP_RECOVERY, 133 CP_DISCARD, 134}; | 128#define CP_UMOUNT 0x00000001 129#define CP_FASTBOOT 0x00000002 130#define CP_SYNC 0x00000004 131#define CP_RECOVERY 0x00000008 132#define CP_DISCARD 0x00000010 |
135 136#define DEF_BATCHED_TRIM_SECTIONS 2048 137#define BATCHED_TRIM_SEGMENTS(sbi) \ 138 (GET_SEG_FROM_SEC(sbi, SM_I(sbi)->trim_sections)) 139#define BATCHED_TRIM_BLOCKS(sbi) \ 140 (BATCHED_TRIM_SEGMENTS(sbi) << (sbi)->log_blocks_per_seg) 141#define MAX_DISCARD_BLOCKS(sbi) BLKS_PER_SEC(sbi) 142#define DISCARD_ISSUE_RATE 8 --- 1117 unchanged lines hidden (view full) --- 1260 spin_unlock(&sbi->cp_lock); 1261} 1262 1263static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi, 1264 struct cp_control *cpc) 1265{ 1266 bool set = is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1267 | 133 134#define DEF_BATCHED_TRIM_SECTIONS 2048 135#define BATCHED_TRIM_SEGMENTS(sbi) \ 136 (GET_SEG_FROM_SEC(sbi, SM_I(sbi)->trim_sections)) 137#define BATCHED_TRIM_BLOCKS(sbi) \ 138 (BATCHED_TRIM_SEGMENTS(sbi) << (sbi)->log_blocks_per_seg) 139#define MAX_DISCARD_BLOCKS(sbi) BLKS_PER_SEC(sbi) 140#define DISCARD_ISSUE_RATE 8 --- 1117 unchanged lines hidden (view full) --- 1258 spin_unlock(&sbi->cp_lock); 1259} 1260 1261static inline bool enabled_nat_bits(struct f2fs_sb_info *sbi, 1262 struct cp_control *cpc) 1263{ 1264 bool set = is_set_ckpt_flags(sbi, CP_NAT_BITS_FLAG); 1265 |
1268 return (cpc) ? (cpc->reason == CP_UMOUNT) && set : set; | 1266 return (cpc) ? (cpc->reason & CP_UMOUNT) && set : set; |
1269} 1270 1271static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) 1272{ 1273 down_read(&sbi->cp_rwsem); 1274} 1275 1276static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) --- 19 unchanged lines hidden (view full) --- 1296 reason = CP_FASTBOOT; 1297 if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) 1298 reason = CP_UMOUNT; 1299 return reason; 1300} 1301 1302static inline bool __remain_node_summaries(int reason) 1303{ | 1267} 1268 1269static inline void f2fs_lock_op(struct f2fs_sb_info *sbi) 1270{ 1271 down_read(&sbi->cp_rwsem); 1272} 1273 1274static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi) --- 19 unchanged lines hidden (view full) --- 1294 reason = CP_FASTBOOT; 1295 if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) 1296 reason = CP_UMOUNT; 1297 return reason; 1298} 1299 1300static inline bool __remain_node_summaries(int reason) 1301{ |
1304 return (reason == CP_UMOUNT || reason == CP_FASTBOOT); | 1302 return (reason & (CP_UMOUNT | CP_FASTBOOT)); |
1305} 1306 1307static inline bool __exist_node_summaries(struct f2fs_sb_info *sbi) 1308{ 1309 return (is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG) || 1310 is_set_ckpt_flags(sbi, CP_FASTBOOT_FLAG)); 1311} 1312 --- 1416 unchanged lines hidden --- | 1303} 1304 1305static inline bool __exist_node_summaries(struct f2fs_sb_info *sbi) 1306{ 1307 return (is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG) || 1308 is_set_ckpt_flags(sbi, CP_FASTBOOT_FLAG)); 1309} 1310 --- 1416 unchanged lines hidden --- |