• Home
  • Raw
  • Download

Lines Matching refs:sbi

52 	struct ext2_sb_info *sbi = EXT2_SB(sb);  in ext2_error()  local
53 struct ext2_super_block *es = sbi->s_es; in ext2_error()
56 spin_lock(&sbi->s_lock); in ext2_error()
57 sbi->s_mount_state |= EXT2_ERROR_FS; in ext2_error()
59 spin_unlock(&sbi->s_lock); in ext2_error()
130 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_put_super() local
134 if (sbi->s_mb_cache) { in ext2_put_super()
135 ext2_xattr_destroy_cache(sbi->s_mb_cache); in ext2_put_super()
136 sbi->s_mb_cache = NULL; in ext2_put_super()
139 struct ext2_super_block *es = sbi->s_es; in ext2_put_super()
141 spin_lock(&sbi->s_lock); in ext2_put_super()
142 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_put_super()
143 spin_unlock(&sbi->s_lock); in ext2_put_super()
146 db_count = sbi->s_gdb_count; in ext2_put_super()
148 if (sbi->s_group_desc[i]) in ext2_put_super()
149 brelse (sbi->s_group_desc[i]); in ext2_put_super()
150 kfree(sbi->s_group_desc); in ext2_put_super()
151 kfree(sbi->s_debts); in ext2_put_super()
152 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_put_super()
153 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_put_super()
154 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_put_super()
155 brelse (sbi->s_sbh); in ext2_put_super()
157 kfree(sbi->s_blockgroup_lock); in ext2_put_super()
158 kfree(sbi); in ext2_put_super()
229 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_show_options() local
230 struct ext2_super_block *es = sbi->s_es; in ext2_show_options()
233 spin_lock(&sbi->s_lock); in ext2_show_options()
236 if (sbi->s_sb_block != 1) in ext2_show_options()
237 seq_printf(seq, ",sb=%lu", sbi->s_sb_block); in ext2_show_options()
244 if (!uid_eq(sbi->s_resuid, make_kuid(&init_user_ns, EXT2_DEF_RESUID)) || in ext2_show_options()
247 from_kuid_munged(&init_user_ns, sbi->s_resuid)); in ext2_show_options()
249 if (!gid_eq(sbi->s_resgid, make_kgid(&init_user_ns, EXT2_DEF_RESGID)) || in ext2_show_options()
252 from_kgid_munged(&init_user_ns, sbi->s_resgid)); in ext2_show_options()
293 if (sbi->s_mount_opt & EXT2_MOUNT_USRQUOTA) in ext2_show_options()
296 if (sbi->s_mount_opt & EXT2_MOUNT_GRPQUOTA) in ext2_show_options()
301 if (sbi->s_mount_opt & EXT2_MOUNT_XIP) in ext2_show_options()
303 if (sbi->s_mount_opt & EXT2_MOUNT_DAX) in ext2_show_options()
310 spin_unlock(&sbi->s_lock); in ext2_show_options()
455 struct ext2_sb_info *sbi = EXT2_SB(sb); in parse_options() local
472 clear_opt (sbi->s_mount_opt, MINIX_DF); in parse_options()
475 set_opt (sbi->s_mount_opt, MINIX_DF); in parse_options()
478 set_opt (sbi->s_mount_opt, GRPID); in parse_options()
481 clear_opt (sbi->s_mount_opt, GRPID); in parse_options()
492 sbi->s_resuid = uid; in parse_options()
502 sbi->s_resgid = gid; in parse_options()
509 clear_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
510 clear_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
511 set_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
514 clear_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
515 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
516 set_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
519 clear_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
520 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
521 set_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
524 set_opt (sbi->s_mount_opt, NO_UID32); in parse_options()
527 clear_opt (sbi->s_mount_opt, CHECK); in parse_options()
530 set_opt (sbi->s_mount_opt, DEBUG); in parse_options()
533 set_opt (sbi->s_mount_opt, OLDALLOC); in parse_options()
536 clear_opt (sbi->s_mount_opt, OLDALLOC); in parse_options()
539 set_opt (sbi->s_mount_opt, NOBH); in parse_options()
543 set_opt (sbi->s_mount_opt, XATTR_USER); in parse_options()
546 clear_opt (sbi->s_mount_opt, XATTR_USER); in parse_options()
557 set_opt(sbi->s_mount_opt, POSIX_ACL); in parse_options()
560 clear_opt(sbi->s_mount_opt, POSIX_ACL); in parse_options()
571 set_opt(sbi->s_mount_opt, XIP); in parse_options()
577 set_opt(sbi->s_mount_opt, DAX); in parse_options()
586 set_opt(sbi->s_mount_opt, USRQUOTA); in parse_options()
590 set_opt(sbi->s_mount_opt, GRPQUOTA); in parse_options()
602 set_opt(sbi->s_mount_opt, RESERVATION); in parse_options()
606 clear_opt(sbi->s_mount_opt, RESERVATION); in parse_options()
623 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_setup_super() local
633 if (!(sbi->s_mount_state & EXT2_VALID_FS)) in ext2_setup_super()
637 else if ((sbi->s_mount_state & EXT2_ERROR_FS)) in ext2_setup_super()
660 sbi->s_frag_size, in ext2_setup_super()
661 sbi->s_groups_count, in ext2_setup_super()
664 sbi->s_mount_opt); in ext2_setup_super()
671 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_check_descriptors() local
675 for (i = 0; i < sbi->s_groups_count; i++) { in ext2_check_descriptors()
680 if (i == sbi->s_groups_count - 1) in ext2_check_descriptors()
681 last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; in ext2_check_descriptors()
705 le32_to_cpu(gdp->bg_inode_table) + sbi->s_itb_per_group - 1 > in ext2_check_descriptors()
769 struct ext2_sb_info *sbi = EXT2_SB(sb); in descriptor_loc() local
773 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); in descriptor_loc()
778 bg = sbi->s_desc_per_block * nr; in descriptor_loc()
788 struct ext2_sb_info * sbi; in ext2_fill_super() local
804 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in ext2_fill_super()
805 if (!sbi) in ext2_fill_super()
808 sbi->s_blockgroup_lock = in ext2_fill_super()
810 if (!sbi->s_blockgroup_lock) { in ext2_fill_super()
811 kfree(sbi); in ext2_fill_super()
814 sb->s_fs_info = sbi; in ext2_fill_super()
815 sbi->s_sb_block = sb_block; in ext2_fill_super()
817 spin_lock_init(&sbi->s_lock); in ext2_fill_super()
852 sbi->s_es = es; in ext2_fill_super()
861 set_opt(sbi->s_mount_opt, DEBUG); in ext2_fill_super()
863 set_opt(sbi->s_mount_opt, GRPID); in ext2_fill_super()
865 set_opt(sbi->s_mount_opt, NO_UID32); in ext2_fill_super()
868 set_opt(sbi->s_mount_opt, XATTR_USER); in ext2_fill_super()
872 set_opt(sbi->s_mount_opt, POSIX_ACL); in ext2_fill_super()
875 if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) in ext2_fill_super()
876 set_opt(sbi->s_mount_opt, ERRORS_PANIC); in ext2_fill_super()
877 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) in ext2_fill_super()
878 set_opt(sbi->s_mount_opt, ERRORS_CONT); in ext2_fill_super()
880 set_opt(sbi->s_mount_opt, ERRORS_RO); in ext2_fill_super()
882 sbi->s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid)); in ext2_fill_super()
883 sbi->s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid)); in ext2_fill_super()
885 set_opt(sbi->s_mount_opt, RESERVATION); in ext2_fill_super()
922 blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); in ext2_fill_super()
924 if (sbi->s_mount_opt & EXT2_MOUNT_DAX) { in ext2_fill_super()
949 sbi->s_es = es; in ext2_fill_super()
960 sbi->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; in ext2_fill_super()
961 sbi->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; in ext2_fill_super()
963 sbi->s_inode_size = le16_to_cpu(es->s_inode_size); in ext2_fill_super()
964 sbi->s_first_ino = le32_to_cpu(es->s_first_ino); in ext2_fill_super()
965 if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) || in ext2_fill_super()
966 !is_power_of_2(sbi->s_inode_size) || in ext2_fill_super()
967 (sbi->s_inode_size > blocksize)) { in ext2_fill_super()
970 sbi->s_inode_size); in ext2_fill_super()
975 sbi->s_frag_size = EXT2_MIN_FRAG_SIZE << in ext2_fill_super()
977 if (sbi->s_frag_size == 0) in ext2_fill_super()
979 sbi->s_frags_per_block = sb->s_blocksize / sbi->s_frag_size; in ext2_fill_super()
981 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); in ext2_fill_super()
982 sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group); in ext2_fill_super()
983 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); in ext2_fill_super()
987 sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb); in ext2_fill_super()
988 if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0) in ext2_fill_super()
990 sbi->s_itb_per_group = sbi->s_inodes_per_group / in ext2_fill_super()
991 sbi->s_inodes_per_block; in ext2_fill_super()
992 sbi->s_desc_per_block = sb->s_blocksize / in ext2_fill_super()
994 sbi->s_sbh = bh; in ext2_fill_super()
995 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_fill_super()
996 sbi->s_addr_per_block_bits = in ext2_fill_super()
998 sbi->s_desc_per_block_bits = in ext2_fill_super()
1010 if (sb->s_blocksize != sbi->s_frag_size) { in ext2_fill_super()
1014 sbi->s_frag_size, sb->s_blocksize); in ext2_fill_super()
1018 if (sbi->s_blocks_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
1021 sbi->s_blocks_per_group); in ext2_fill_super()
1024 if (sbi->s_frags_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
1027 sbi->s_frags_per_group); in ext2_fill_super()
1030 if (sbi->s_inodes_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
1033 sbi->s_inodes_per_group); in ext2_fill_super()
1039 sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) - in ext2_fill_super()
1042 db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / in ext2_fill_super()
1044 sbi->s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL); in ext2_fill_super()
1045 if (sbi->s_group_desc == NULL) { in ext2_fill_super()
1049 bgl_lock_init(sbi->s_blockgroup_lock); in ext2_fill_super()
1050 sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); in ext2_fill_super()
1051 if (!sbi->s_debts) { in ext2_fill_super()
1057 sbi->s_group_desc[i] = sb_bread(sb, block); in ext2_fill_super()
1058 if (!sbi->s_group_desc[i]) { in ext2_fill_super()
1060 brelse (sbi->s_group_desc[j]); in ext2_fill_super()
1070 sbi->s_gdb_count = db_count; in ext2_fill_super()
1071 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); in ext2_fill_super()
1072 spin_lock_init(&sbi->s_next_gen_lock); in ext2_fill_super()
1075 spin_lock_init(&sbi->s_rsv_window_lock); in ext2_fill_super()
1076 sbi->s_rsv_window_root = RB_ROOT; in ext2_fill_super()
1083 sbi->s_rsv_window_head.rsv_start = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1084 sbi->s_rsv_window_head.rsv_end = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1085 sbi->s_rsv_window_head.rsv_alloc_hit = 0; in ext2_fill_super()
1086 sbi->s_rsv_window_head.rsv_goal_size = 0; in ext2_fill_super()
1087 ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); in ext2_fill_super()
1089 err = percpu_counter_init(&sbi->s_freeblocks_counter, in ext2_fill_super()
1092 err = percpu_counter_init(&sbi->s_freeinodes_counter, in ext2_fill_super()
1096 err = percpu_counter_init(&sbi->s_dirs_counter, in ext2_fill_super()
1105 sbi->s_mb_cache = ext2_xattr_create_cache(); in ext2_fill_super()
1106 if (!sbi->s_mb_cache) { in ext2_fill_super()
1156 if (sbi->s_mb_cache) in ext2_fill_super()
1157 ext2_xattr_destroy_cache(sbi->s_mb_cache); in ext2_fill_super()
1158 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_fill_super()
1159 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_fill_super()
1160 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_fill_super()
1163 brelse(sbi->s_group_desc[i]); in ext2_fill_super()
1165 kfree(sbi->s_group_desc); in ext2_fill_super()
1166 kfree(sbi->s_debts); in ext2_fill_super()
1171 kfree(sbi->s_blockgroup_lock); in ext2_fill_super()
1172 kfree(sbi); in ext2_fill_super()
1224 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_sync_fs() local
1233 spin_lock(&sbi->s_lock); in ext2_sync_fs()
1238 spin_unlock(&sbi->s_lock); in ext2_sync_fs()
1245 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_freeze() local
1257 spin_lock(&sbi->s_lock); in ext2_freeze()
1258 sbi->s_es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_freeze()
1259 spin_unlock(&sbi->s_lock); in ext2_freeze()
1260 ext2_sync_super(sb, sbi->s_es, 1); in ext2_freeze()
1281 struct ext2_sb_info * sbi = EXT2_SB(sb); in ext2_remount() local
1288 spin_lock(&sbi->s_lock); in ext2_remount()
1292 old_opts.s_mount_opt = sbi->s_mount_opt; in ext2_remount()
1293 old_opts.s_resuid = sbi->s_resuid; in ext2_remount()
1294 old_opts.s_resgid = sbi->s_resgid; in ext2_remount()
1305 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); in ext2_remount()
1307 es = sbi->s_es; in ext2_remount()
1308 if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_DAX) { in ext2_remount()
1311 sbi->s_mount_opt ^= EXT2_MOUNT_DAX; in ext2_remount()
1314 spin_unlock(&sbi->s_lock); in ext2_remount()
1319 !(sbi->s_mount_state & EXT2_VALID_FS)) { in ext2_remount()
1320 spin_unlock(&sbi->s_lock); in ext2_remount()
1328 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_remount()
1330 spin_unlock(&sbi->s_lock); in ext2_remount()
1334 spin_lock(&sbi->s_lock); in ext2_remount()
1355 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_remount()
1358 spin_unlock(&sbi->s_lock); in ext2_remount()
1367 sbi->s_mount_opt = old_opts.s_mount_opt; in ext2_remount()
1368 sbi->s_resuid = old_opts.s_resuid; in ext2_remount()
1369 sbi->s_resgid = old_opts.s_resgid; in ext2_remount()
1371 spin_unlock(&sbi->s_lock); in ext2_remount()
1378 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_statfs() local
1379 struct ext2_super_block *es = sbi->s_es; in ext2_statfs()
1382 spin_lock(&sbi->s_lock); in ext2_statfs()
1385 sbi->s_overhead_last = 0; in ext2_statfs()
1386 else if (sbi->s_blocks_last != le32_to_cpu(es->s_blocks_count)) { in ext2_statfs()
1407 for (i = 0; i < sbi->s_groups_count; i++) in ext2_statfs()
1415 overhead += (sbi->s_groups_count * in ext2_statfs()
1416 (2 + sbi->s_itb_per_group)); in ext2_statfs()
1417 sbi->s_overhead_last = overhead; in ext2_statfs()
1419 sbi->s_blocks_last = le32_to_cpu(es->s_blocks_count); in ext2_statfs()
1424 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last; in ext2_statfs()
1438 spin_unlock(&sbi->s_lock); in ext2_statfs()