super.c (6aefd93b01379bf0b62f8b38dcf7a21397893833) | super.c (60b99b486b568c13cbb7caa83cf8a12af7665f1e) |
---|---|
1/* 2 * fs/f2fs/super.c 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 --- 201 unchanged lines hidden (view full) --- 210F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, max_small_discards, max_discards); 211F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, batched_trim_sections, trim_sections); 212F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, ipu_policy, ipu_policy); 213F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_ipu_util, min_ipu_util); 214F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_fsync_blocks, min_fsync_blocks); 215F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ram_thresh, ram_thresh); 216F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, max_victim_search, max_victim_search); 217F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, dir_level, dir_level); | 1/* 2 * fs/f2fs/super.c 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 --- 201 unchanged lines hidden (view full) --- 210F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, max_small_discards, max_discards); 211F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, batched_trim_sections, trim_sections); 212F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, ipu_policy, ipu_policy); 213F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_ipu_util, min_ipu_util); 214F2FS_RW_ATTR(SM_INFO, f2fs_sm_info, min_fsync_blocks, min_fsync_blocks); 215F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ram_thresh, ram_thresh); 216F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, max_victim_search, max_victim_search); 217F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, dir_level, dir_level); |
218F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, cp_interval, cp_interval); |
|
218 219#define ATTR_LIST(name) (&f2fs_attr_##name.attr) 220static struct attribute *f2fs_attrs[] = { 221 ATTR_LIST(gc_min_sleep_time), 222 ATTR_LIST(gc_max_sleep_time), 223 ATTR_LIST(gc_no_gc_sleep_time), 224 ATTR_LIST(gc_idle), 225 ATTR_LIST(reclaim_segments), 226 ATTR_LIST(max_small_discards), 227 ATTR_LIST(batched_trim_sections), 228 ATTR_LIST(ipu_policy), 229 ATTR_LIST(min_ipu_util), 230 ATTR_LIST(min_fsync_blocks), 231 ATTR_LIST(max_victim_search), 232 ATTR_LIST(dir_level), 233 ATTR_LIST(ram_thresh), | 219 220#define ATTR_LIST(name) (&f2fs_attr_##name.attr) 221static struct attribute *f2fs_attrs[] = { 222 ATTR_LIST(gc_min_sleep_time), 223 ATTR_LIST(gc_max_sleep_time), 224 ATTR_LIST(gc_no_gc_sleep_time), 225 ATTR_LIST(gc_idle), 226 ATTR_LIST(reclaim_segments), 227 ATTR_LIST(max_small_discards), 228 ATTR_LIST(batched_trim_sections), 229 ATTR_LIST(ipu_policy), 230 ATTR_LIST(min_ipu_util), 231 ATTR_LIST(min_fsync_blocks), 232 ATTR_LIST(max_victim_search), 233 ATTR_LIST(dir_level), 234 ATTR_LIST(ram_thresh), |
235 ATTR_LIST(cp_interval), |
|
234 NULL, 235}; 236 237static const struct sysfs_ops f2fs_attr_ops = { 238 .show = f2fs_attr_show, 239 .store = f2fs_attr_store, 240}; 241 --- 767 unchanged lines hidden (view full) --- 1009 sbi->meta_ino_num = le32_to_cpu(raw_super->meta_ino); 1010 sbi->cur_victim_sec = NULL_SECNO; 1011 sbi->max_victim_search = DEF_MAX_VICTIM_SEARCH; 1012 1013 for (i = 0; i < NR_COUNT_TYPE; i++) 1014 atomic_set(&sbi->nr_pages[i], 0); 1015 1016 sbi->dir_level = DEF_DIR_LEVEL; | 236 NULL, 237}; 238 239static const struct sysfs_ops f2fs_attr_ops = { 240 .show = f2fs_attr_show, 241 .store = f2fs_attr_store, 242}; 243 --- 767 unchanged lines hidden (view full) --- 1011 sbi->meta_ino_num = le32_to_cpu(raw_super->meta_ino); 1012 sbi->cur_victim_sec = NULL_SECNO; 1013 sbi->max_victim_search = DEF_MAX_VICTIM_SEARCH; 1014 1015 for (i = 0; i < NR_COUNT_TYPE; i++) 1016 atomic_set(&sbi->nr_pages[i], 0); 1017 1018 sbi->dir_level = DEF_DIR_LEVEL; |
1019 sbi->cp_interval = DEF_CP_INTERVAL; |
|
1017 clear_sbi_flag(sbi, SBI_NEED_FSCK); 1018 1019 INIT_LIST_HEAD(&sbi->s_list); 1020 mutex_init(&sbi->umount_mutex); 1021} 1022 1023/* 1024 * Read f2fs raw super block. --- 320 unchanged lines hidden (view full) --- 1345 kfree(options); 1346 1347 /* recover broken superblock */ 1348 if (recovery && !f2fs_readonly(sb) && !bdev_read_only(sb->s_bdev)) { 1349 f2fs_msg(sb, KERN_INFO, "Recover invalid superblock"); 1350 f2fs_commit_super(sbi, true); 1351 } 1352 | 1020 clear_sbi_flag(sbi, SBI_NEED_FSCK); 1021 1022 INIT_LIST_HEAD(&sbi->s_list); 1023 mutex_init(&sbi->umount_mutex); 1024} 1025 1026/* 1027 * Read f2fs raw super block. --- 320 unchanged lines hidden (view full) --- 1348 kfree(options); 1349 1350 /* recover broken superblock */ 1351 if (recovery && !f2fs_readonly(sb) && !bdev_read_only(sb->s_bdev)) { 1352 f2fs_msg(sb, KERN_INFO, "Recover invalid superblock"); 1353 f2fs_commit_super(sbi, true); 1354 } 1355 |
1356 sbi->cp_expires = round_jiffies_up(jiffies); 1357 |
|
1353 return 0; 1354 1355free_kobj: 1356 kobject_del(&sbi->s_kobj); 1357free_proc: 1358 if (sbi->s_proc) { 1359 remove_proc_entry("segment_info", sbi->s_proc); 1360 remove_proc_entry(sb->s_id, f2fs_proc_root); --- 159 unchanged lines hidden --- | 1358 return 0; 1359 1360free_kobj: 1361 kobject_del(&sbi->s_kobj); 1362free_proc: 1363 if (sbi->s_proc) { 1364 remove_proc_entry("segment_info", sbi->s_proc); 1365 remove_proc_entry(sb->s_id, f2fs_proc_root); --- 159 unchanged lines hidden --- |