• Home
  • Raw
  • Download

Lines Matching refs:sbi

54 	struct ext2_sb_info *sbi = EXT2_SB(sb);  in ext2_error()  local
55 struct ext2_super_block *es = sbi->s_es; in ext2_error()
58 spin_lock(&sbi->s_lock); in ext2_error()
59 sbi->s_mount_state |= EXT2_ERROR_FS; in ext2_error()
61 spin_unlock(&sbi->s_lock); in ext2_error()
148 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_put_super() local
152 ext2_xattr_destroy_cache(sbi->s_ea_block_cache); in ext2_put_super()
153 sbi->s_ea_block_cache = NULL; in ext2_put_super()
156 struct ext2_super_block *es = sbi->s_es; in ext2_put_super()
158 spin_lock(&sbi->s_lock); in ext2_put_super()
159 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_put_super()
160 spin_unlock(&sbi->s_lock); in ext2_put_super()
163 db_count = sbi->s_gdb_count; in ext2_put_super()
165 brelse(sbi->s_group_desc[i]); in ext2_put_super()
166 kfree(sbi->s_group_desc); in ext2_put_super()
167 kfree(sbi->s_debts); in ext2_put_super()
168 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_put_super()
169 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_put_super()
170 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_put_super()
171 brelse (sbi->s_sbh); in ext2_put_super()
173 kfree(sbi->s_blockgroup_lock); in ext2_put_super()
174 fs_put_dax(sbi->s_daxdev); in ext2_put_super()
175 kfree(sbi); in ext2_put_super()
242 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_show_options() local
243 struct ext2_super_block *es = sbi->s_es; in ext2_show_options()
246 spin_lock(&sbi->s_lock); in ext2_show_options()
249 if (sbi->s_sb_block != 1) in ext2_show_options()
250 seq_printf(seq, ",sb=%lu", sbi->s_sb_block); in ext2_show_options()
257 if (!uid_eq(sbi->s_resuid, make_kuid(&init_user_ns, EXT2_DEF_RESUID)) || in ext2_show_options()
260 from_kuid_munged(&init_user_ns, sbi->s_resuid)); in ext2_show_options()
262 if (!gid_eq(sbi->s_resgid, make_kgid(&init_user_ns, EXT2_DEF_RESGID)) || in ext2_show_options()
265 from_kgid_munged(&init_user_ns, sbi->s_resgid)); in ext2_show_options()
320 spin_unlock(&sbi->s_lock); in ext2_show_options()
649 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_setup_super() local
659 if (!(sbi->s_mount_state & EXT2_VALID_FS)) in ext2_setup_super()
663 else if ((sbi->s_mount_state & EXT2_ERROR_FS)) in ext2_setup_super()
687 sbi->s_groups_count, in ext2_setup_super()
690 sbi->s_mount_opt); in ext2_setup_super()
697 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_check_descriptors() local
701 for (i = 0; i < sbi->s_groups_count; i++) { in ext2_check_descriptors()
706 if (i == sbi->s_groups_count - 1) in ext2_check_descriptors()
707 last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; in ext2_check_descriptors()
731 le32_to_cpu(gdp->bg_inode_table) + sbi->s_itb_per_group - 1 > in ext2_check_descriptors()
810 struct ext2_sb_info *sbi = EXT2_SB(sb); in descriptor_loc() local
814 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); in descriptor_loc()
819 bg = sbi->s_desc_per_block * nr; in descriptor_loc()
830 struct ext2_sb_info * sbi; in ext2_fill_super() local
846 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in ext2_fill_super()
847 if (!sbi) in ext2_fill_super()
850 sbi->s_blockgroup_lock = in ext2_fill_super()
852 if (!sbi->s_blockgroup_lock) { in ext2_fill_super()
853 kfree(sbi); in ext2_fill_super()
856 sb->s_fs_info = sbi; in ext2_fill_super()
857 sbi->s_sb_block = sb_block; in ext2_fill_super()
858 sbi->s_daxdev = dax_dev; in ext2_fill_super()
860 spin_lock_init(&sbi->s_lock); in ext2_fill_super()
896 sbi->s_es = es; in ext2_fill_super()
920 if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) in ext2_fill_super()
922 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) in ext2_fill_super()
935 sbi->s_mount_opt = opts.s_mount_opt; in ext2_fill_super()
936 sbi->s_resuid = opts.s_resuid; in ext2_fill_super()
937 sbi->s_resgid = opts.s_resgid; in ext2_fill_super()
976 blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); in ext2_fill_super()
982 clear_opt(sbi->s_mount_opt, DAX); in ext2_fill_super()
1005 sbi->s_es = es; in ext2_fill_super()
1018 sbi->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; in ext2_fill_super()
1019 sbi->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; in ext2_fill_super()
1021 sbi->s_inode_size = le16_to_cpu(es->s_inode_size); in ext2_fill_super()
1022 sbi->s_first_ino = le32_to_cpu(es->s_first_ino); in ext2_fill_super()
1023 if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) || in ext2_fill_super()
1024 !is_power_of_2(sbi->s_inode_size) || in ext2_fill_super()
1025 (sbi->s_inode_size > blocksize)) { in ext2_fill_super()
1028 sbi->s_inode_size); in ext2_fill_super()
1033 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); in ext2_fill_super()
1034 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); in ext2_fill_super()
1036 sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb); in ext2_fill_super()
1037 if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0) in ext2_fill_super()
1039 sbi->s_itb_per_group = sbi->s_inodes_per_group / in ext2_fill_super()
1040 sbi->s_inodes_per_block; in ext2_fill_super()
1041 sbi->s_desc_per_block = sb->s_blocksize / in ext2_fill_super()
1043 sbi->s_sbh = bh; in ext2_fill_super()
1044 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_fill_super()
1045 sbi->s_addr_per_block_bits = in ext2_fill_super()
1047 sbi->s_desc_per_block_bits = in ext2_fill_super()
1066 if (sbi->s_blocks_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
1069 sbi->s_blocks_per_group); in ext2_fill_super()
1072 if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || in ext2_fill_super()
1073 sbi->s_inodes_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
1076 sbi->s_inodes_per_group); in ext2_fill_super()
1082 sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) - in ext2_fill_super()
1085 if ((u64)sbi->s_groups_count * sbi->s_inodes_per_group != in ext2_fill_super()
1089 (u64)sbi->s_groups_count * sbi->s_inodes_per_group); in ext2_fill_super()
1092 db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / in ext2_fill_super()
1094 sbi->s_group_desc = kmalloc_array (db_count, in ext2_fill_super()
1097 if (sbi->s_group_desc == NULL) { in ext2_fill_super()
1102 bgl_lock_init(sbi->s_blockgroup_lock); in ext2_fill_super()
1103 sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); in ext2_fill_super()
1104 if (!sbi->s_debts) { in ext2_fill_super()
1111 sbi->s_group_desc[i] = sb_bread(sb, block); in ext2_fill_super()
1112 if (!sbi->s_group_desc[i]) { in ext2_fill_super()
1114 brelse (sbi->s_group_desc[j]); in ext2_fill_super()
1124 sbi->s_gdb_count = db_count; in ext2_fill_super()
1125 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); in ext2_fill_super()
1126 spin_lock_init(&sbi->s_next_gen_lock); in ext2_fill_super()
1129 spin_lock_init(&sbi->s_rsv_window_lock); in ext2_fill_super()
1130 sbi->s_rsv_window_root = RB_ROOT; in ext2_fill_super()
1137 sbi->s_rsv_window_head.rsv_start = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1138 sbi->s_rsv_window_head.rsv_end = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1139 sbi->s_rsv_window_head.rsv_alloc_hit = 0; in ext2_fill_super()
1140 sbi->s_rsv_window_head.rsv_goal_size = 0; in ext2_fill_super()
1141 ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); in ext2_fill_super()
1143 err = percpu_counter_init(&sbi->s_freeblocks_counter, in ext2_fill_super()
1146 err = percpu_counter_init(&sbi->s_freeinodes_counter, in ext2_fill_super()
1150 err = percpu_counter_init(&sbi->s_dirs_counter, in ext2_fill_super()
1159 sbi->s_ea_block_cache = ext2_xattr_create_cache(); in ext2_fill_super()
1160 if (!sbi->s_ea_block_cache) { in ext2_fill_super()
1211 ext2_xattr_destroy_cache(sbi->s_ea_block_cache); in ext2_fill_super()
1212 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_fill_super()
1213 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_fill_super()
1214 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_fill_super()
1217 brelse(sbi->s_group_desc[i]); in ext2_fill_super()
1219 kfree(sbi->s_group_desc); in ext2_fill_super()
1220 kfree(sbi->s_debts); in ext2_fill_super()
1225 kfree(sbi->s_blockgroup_lock); in ext2_fill_super()
1226 kfree(sbi); in ext2_fill_super()
1279 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_sync_fs() local
1288 spin_lock(&sbi->s_lock); in ext2_sync_fs()
1293 spin_unlock(&sbi->s_lock); in ext2_sync_fs()
1300 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_freeze() local
1312 spin_lock(&sbi->s_lock); in ext2_freeze()
1313 sbi->s_es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_freeze()
1314 spin_unlock(&sbi->s_lock); in ext2_freeze()
1315 ext2_sync_super(sb, sbi->s_es, 1); in ext2_freeze()
1336 struct ext2_sb_info * sbi = EXT2_SB(sb); in ext2_remount() local
1343 spin_lock(&sbi->s_lock); in ext2_remount()
1344 new_opts.s_mount_opt = sbi->s_mount_opt; in ext2_remount()
1345 new_opts.s_resuid = sbi->s_resuid; in ext2_remount()
1346 new_opts.s_resgid = sbi->s_resgid; in ext2_remount()
1347 spin_unlock(&sbi->s_lock); in ext2_remount()
1352 spin_lock(&sbi->s_lock); in ext2_remount()
1353 es = sbi->s_es; in ext2_remount()
1354 if ((sbi->s_mount_opt ^ new_opts.s_mount_opt) & EXT2_MOUNT_DAX) { in ext2_remount()
1363 !(sbi->s_mount_state & EXT2_VALID_FS)) in ext2_remount()
1370 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_remount()
1372 spin_unlock(&sbi->s_lock); in ext2_remount()
1383 spin_unlock(&sbi->s_lock); in ext2_remount()
1395 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_remount()
1398 spin_unlock(&sbi->s_lock); in ext2_remount()
1405 spin_lock(&sbi->s_lock); in ext2_remount()
1407 sbi->s_mount_opt = new_opts.s_mount_opt; in ext2_remount()
1408 sbi->s_resuid = new_opts.s_resuid; in ext2_remount()
1409 sbi->s_resgid = new_opts.s_resgid; in ext2_remount()
1412 spin_unlock(&sbi->s_lock); in ext2_remount()
1420 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_statfs() local
1421 struct ext2_super_block *es = sbi->s_es; in ext2_statfs()
1424 spin_lock(&sbi->s_lock); in ext2_statfs()
1427 sbi->s_overhead_last = 0; in ext2_statfs()
1428 else if (sbi->s_blocks_last != le32_to_cpu(es->s_blocks_count)) { in ext2_statfs()
1449 for (i = 0; i < sbi->s_groups_count; i++) in ext2_statfs()
1457 overhead += (sbi->s_groups_count * in ext2_statfs()
1458 (2 + sbi->s_itb_per_group)); in ext2_statfs()
1459 sbi->s_overhead_last = overhead; in ext2_statfs()
1461 sbi->s_blocks_last = le32_to_cpu(es->s_blocks_count); in ext2_statfs()
1466 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last; in ext2_statfs()
1480 spin_unlock(&sbi->s_lock); in ext2_statfs()