• Home
  • Raw
  • Download

Lines Matching refs:sbi

50 	struct ext2_sb_info *sbi = EXT2_SB(sb);  in ext2_error()  local
51 struct ext2_super_block *es = sbi->s_es; in ext2_error()
54 sbi->s_mount_state |= EXT2_ERROR_FS; in ext2_error()
115 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_put_super() local
119 struct ext2_super_block *es = sbi->s_es; in ext2_put_super()
121 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_put_super()
124 db_count = sbi->s_gdb_count; in ext2_put_super()
126 if (sbi->s_group_desc[i]) in ext2_put_super()
127 brelse (sbi->s_group_desc[i]); in ext2_put_super()
128 kfree(sbi->s_group_desc); in ext2_put_super()
129 kfree(sbi->s_debts); in ext2_put_super()
130 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_put_super()
131 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_put_super()
132 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_put_super()
133 brelse (sbi->s_sbh); in ext2_put_super()
135 kfree(sbi->s_blockgroup_lock); in ext2_put_super()
136 kfree(sbi); in ext2_put_super()
216 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_show_options() local
217 struct ext2_super_block *es = sbi->s_es; in ext2_show_options()
222 if (sbi->s_sb_block != 1) in ext2_show_options()
223 seq_printf(seq, ",sb=%lu", sbi->s_sb_block); in ext2_show_options()
230 if (sbi->s_resuid != EXT2_DEF_RESUID || in ext2_show_options()
232 seq_printf(seq, ",resuid=%u", sbi->s_resuid); in ext2_show_options()
234 if (sbi->s_resgid != EXT2_DEF_RESGID || in ext2_show_options()
236 seq_printf(seq, ",resgid=%u", sbi->s_resgid); in ext2_show_options()
277 if (sbi->s_mount_opt & EXT2_MOUNT_USRQUOTA) in ext2_show_options()
280 if (sbi->s_mount_opt & EXT2_MOUNT_GRPQUOTA) in ext2_show_options()
285 if (sbi->s_mount_opt & EXT2_MOUNT_XIP) in ext2_show_options()
432 struct ext2_sb_info *sbi) in parse_options() argument
449 clear_opt (sbi->s_mount_opt, MINIX_DF); in parse_options()
452 set_opt (sbi->s_mount_opt, MINIX_DF); in parse_options()
455 set_opt (sbi->s_mount_opt, GRPID); in parse_options()
458 clear_opt (sbi->s_mount_opt, GRPID); in parse_options()
463 sbi->s_resuid = option; in parse_options()
468 sbi->s_resgid = option; in parse_options()
475 clear_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
476 clear_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
477 set_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
480 clear_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
481 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
482 set_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
485 clear_opt (sbi->s_mount_opt, ERRORS_RO); in parse_options()
486 clear_opt (sbi->s_mount_opt, ERRORS_PANIC); in parse_options()
487 set_opt (sbi->s_mount_opt, ERRORS_CONT); in parse_options()
490 set_opt (sbi->s_mount_opt, NO_UID32); in parse_options()
493 clear_opt (sbi->s_mount_opt, CHECK); in parse_options()
496 set_opt (sbi->s_mount_opt, DEBUG); in parse_options()
499 set_opt (sbi->s_mount_opt, OLDALLOC); in parse_options()
502 clear_opt (sbi->s_mount_opt, OLDALLOC); in parse_options()
505 set_opt (sbi->s_mount_opt, NOBH); in parse_options()
509 set_opt (sbi->s_mount_opt, XATTR_USER); in parse_options()
512 clear_opt (sbi->s_mount_opt, XATTR_USER); in parse_options()
522 set_opt(sbi->s_mount_opt, POSIX_ACL); in parse_options()
525 clear_opt(sbi->s_mount_opt, POSIX_ACL); in parse_options()
535 set_opt (sbi->s_mount_opt, XIP); in parse_options()
544 set_opt(sbi->s_mount_opt, USRQUOTA); in parse_options()
548 set_opt(sbi->s_mount_opt, GRPQUOTA); in parse_options()
561 set_opt(sbi->s_mount_opt, RESERVATION); in parse_options()
565 clear_opt(sbi->s_mount_opt, RESERVATION); in parse_options()
582 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_setup_super() local
591 if (!(sbi->s_mount_state & EXT2_VALID_FS)) in ext2_setup_super()
594 else if ((sbi->s_mount_state & EXT2_ERROR_FS)) in ext2_setup_super()
614 sbi->s_frag_size, in ext2_setup_super()
615 sbi->s_groups_count, in ext2_setup_super()
618 sbi->s_mount_opt); in ext2_setup_super()
625 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_check_descriptors() local
629 for (i = 0; i < sbi->s_groups_count; i++) { in ext2_check_descriptors()
634 if (i == sbi->s_groups_count - 1) in ext2_check_descriptors()
635 last_block = le32_to_cpu(sbi->s_es->s_blocks_count) - 1; in ext2_check_descriptors()
659 le32_to_cpu(gdp->bg_inode_table) + sbi->s_itb_per_group - 1 > in ext2_check_descriptors()
723 struct ext2_sb_info *sbi = EXT2_SB(sb); in descriptor_loc() local
727 first_meta_bg = le32_to_cpu(sbi->s_es->s_first_meta_bg); in descriptor_loc()
732 bg = sbi->s_desc_per_block * nr; in descriptor_loc()
742 struct ext2_sb_info * sbi; in ext2_fill_super() local
757 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in ext2_fill_super()
758 if (!sbi) in ext2_fill_super()
761 sbi->s_blockgroup_lock = in ext2_fill_super()
763 if (!sbi->s_blockgroup_lock) { in ext2_fill_super()
764 kfree(sbi); in ext2_fill_super()
767 sb->s_fs_info = sbi; in ext2_fill_super()
768 sbi->s_sb_block = sb_block; in ext2_fill_super()
803 sbi->s_es = es; in ext2_fill_super()
812 set_opt(sbi->s_mount_opt, DEBUG); in ext2_fill_super()
814 set_opt(sbi->s_mount_opt, GRPID); in ext2_fill_super()
816 set_opt(sbi->s_mount_opt, NO_UID32); in ext2_fill_super()
819 set_opt(sbi->s_mount_opt, XATTR_USER); in ext2_fill_super()
823 set_opt(sbi->s_mount_opt, POSIX_ACL); in ext2_fill_super()
826 if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) in ext2_fill_super()
827 set_opt(sbi->s_mount_opt, ERRORS_PANIC); in ext2_fill_super()
828 else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) in ext2_fill_super()
829 set_opt(sbi->s_mount_opt, ERRORS_CONT); in ext2_fill_super()
831 set_opt(sbi->s_mount_opt, ERRORS_RO); in ext2_fill_super()
833 sbi->s_resuid = le16_to_cpu(es->s_def_resuid); in ext2_fill_super()
834 sbi->s_resgid = le16_to_cpu(es->s_def_resgid); in ext2_fill_super()
836 set_opt(sbi->s_mount_opt, RESERVATION); in ext2_fill_super()
838 if (!parse_options ((char *) data, sbi)) in ext2_fill_super()
874 blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size); in ext2_fill_super()
900 sbi->s_es = es; in ext2_fill_super()
910 sbi->s_inode_size = EXT2_GOOD_OLD_INODE_SIZE; in ext2_fill_super()
911 sbi->s_first_ino = EXT2_GOOD_OLD_FIRST_INO; in ext2_fill_super()
913 sbi->s_inode_size = le16_to_cpu(es->s_inode_size); in ext2_fill_super()
914 sbi->s_first_ino = le32_to_cpu(es->s_first_ino); in ext2_fill_super()
915 if ((sbi->s_inode_size < EXT2_GOOD_OLD_INODE_SIZE) || in ext2_fill_super()
916 !is_power_of_2(sbi->s_inode_size) || in ext2_fill_super()
917 (sbi->s_inode_size > blocksize)) { in ext2_fill_super()
919 sbi->s_inode_size); in ext2_fill_super()
924 sbi->s_frag_size = EXT2_MIN_FRAG_SIZE << in ext2_fill_super()
926 if (sbi->s_frag_size == 0) in ext2_fill_super()
928 sbi->s_frags_per_block = sb->s_blocksize / sbi->s_frag_size; in ext2_fill_super()
930 sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group); in ext2_fill_super()
931 sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group); in ext2_fill_super()
932 sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group); in ext2_fill_super()
936 sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb); in ext2_fill_super()
937 if (sbi->s_inodes_per_block == 0 || sbi->s_inodes_per_group == 0) in ext2_fill_super()
939 sbi->s_itb_per_group = sbi->s_inodes_per_group / in ext2_fill_super()
940 sbi->s_inodes_per_block; in ext2_fill_super()
941 sbi->s_desc_per_block = sb->s_blocksize / in ext2_fill_super()
943 sbi->s_sbh = bh; in ext2_fill_super()
944 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_fill_super()
945 sbi->s_addr_per_block_bits = in ext2_fill_super()
947 sbi->s_desc_per_block_bits = in ext2_fill_super()
960 if (sb->s_blocksize != sbi->s_frag_size) { in ext2_fill_super()
962 sbi->s_frag_size, sb->s_blocksize); in ext2_fill_super()
966 if (sbi->s_blocks_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
968 sbi->s_blocks_per_group); in ext2_fill_super()
971 if (sbi->s_frags_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
973 sbi->s_frags_per_group); in ext2_fill_super()
976 if (sbi->s_inodes_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
978 sbi->s_inodes_per_group); in ext2_fill_super()
984 sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) - in ext2_fill_super()
987 db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / in ext2_fill_super()
989 sbi->s_group_desc = kmalloc (db_count * sizeof (struct buffer_head *), GFP_KERNEL); in ext2_fill_super()
990 if (sbi->s_group_desc == NULL) { in ext2_fill_super()
994 bgl_lock_init(sbi->s_blockgroup_lock); in ext2_fill_super()
995 sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); in ext2_fill_super()
996 if (!sbi->s_debts) { in ext2_fill_super()
1002 sbi->s_group_desc[i] = sb_bread(sb, block); in ext2_fill_super()
1003 if (!sbi->s_group_desc[i]) { in ext2_fill_super()
1005 brelse (sbi->s_group_desc[j]); in ext2_fill_super()
1014 sbi->s_gdb_count = db_count; in ext2_fill_super()
1015 get_random_bytes(&sbi->s_next_generation, sizeof(u32)); in ext2_fill_super()
1016 spin_lock_init(&sbi->s_next_gen_lock); in ext2_fill_super()
1019 spin_lock_init(&sbi->s_rsv_window_lock); in ext2_fill_super()
1020 sbi->s_rsv_window_root = RB_ROOT; in ext2_fill_super()
1027 sbi->s_rsv_window_head.rsv_start = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1028 sbi->s_rsv_window_head.rsv_end = EXT2_RESERVE_WINDOW_NOT_ALLOCATED; in ext2_fill_super()
1029 sbi->s_rsv_window_head.rsv_alloc_hit = 0; in ext2_fill_super()
1030 sbi->s_rsv_window_head.rsv_goal_size = 0; in ext2_fill_super()
1031 ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); in ext2_fill_super()
1033 err = percpu_counter_init(&sbi->s_freeblocks_counter, in ext2_fill_super()
1036 err = percpu_counter_init(&sbi->s_freeinodes_counter, in ext2_fill_super()
1040 err = percpu_counter_init(&sbi->s_dirs_counter, in ext2_fill_super()
1083 percpu_counter_destroy(&sbi->s_freeblocks_counter); in ext2_fill_super()
1084 percpu_counter_destroy(&sbi->s_freeinodes_counter); in ext2_fill_super()
1085 percpu_counter_destroy(&sbi->s_dirs_counter); in ext2_fill_super()
1088 brelse(sbi->s_group_desc[i]); in ext2_fill_super()
1090 kfree(sbi->s_group_desc); in ext2_fill_super()
1091 kfree(sbi->s_debts); in ext2_fill_super()
1096 kfree(sbi); in ext2_fill_super()
1152 struct ext2_sb_info * sbi = EXT2_SB(sb); in ext2_remount() local
1154 unsigned long old_mount_opt = sbi->s_mount_opt; in ext2_remount()
1161 old_opts.s_mount_opt = sbi->s_mount_opt; in ext2_remount()
1162 old_opts.s_resuid = sbi->s_resuid; in ext2_remount()
1163 old_opts.s_resgid = sbi->s_resgid; in ext2_remount()
1168 if (!parse_options (data, sbi)) { in ext2_remount()
1174 ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); in ext2_remount()
1185 es = sbi->s_es; in ext2_remount()
1186 if (((sbi->s_mount_opt & EXT2_MOUNT_XIP) != in ext2_remount()
1191 sbi->s_mount_opt &= ~EXT2_MOUNT_XIP; in ext2_remount()
1192 sbi->s_mount_opt |= old_mount_opt & EXT2_MOUNT_XIP; in ext2_remount()
1198 !(sbi->s_mount_state & EXT2_VALID_FS)) in ext2_remount()
1204 es->s_state = cpu_to_le16(sbi->s_mount_state); in ext2_remount()
1221 sbi->s_mount_state = le16_to_cpu(es->s_state); in ext2_remount()
1228 sbi->s_mount_opt = old_opts.s_mount_opt; in ext2_remount()
1229 sbi->s_resuid = old_opts.s_resuid; in ext2_remount()
1230 sbi->s_resgid = old_opts.s_resgid; in ext2_remount()
1238 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_statfs() local
1239 struct ext2_super_block *es = sbi->s_es; in ext2_statfs()
1243 sbi->s_overhead_last = 0; in ext2_statfs()
1244 else if (sbi->s_blocks_last != le32_to_cpu(es->s_blocks_count)) { in ext2_statfs()
1265 for (i = 0; i < sbi->s_groups_count; i++) in ext2_statfs()
1273 overhead += (sbi->s_groups_count * in ext2_statfs()
1274 (2 + sbi->s_itb_per_group)); in ext2_statfs()
1275 sbi->s_overhead_last = overhead; in ext2_statfs()
1277 sbi->s_blocks_last = le32_to_cpu(es->s_blocks_count); in ext2_statfs()
1282 buf->f_blocks = le32_to_cpu(es->s_blocks_count) - sbi->s_overhead_last; in ext2_statfs()