• Home
  • Raw
  • Download

Lines Matching refs:sb

41 static void ext2_sync_super(struct super_block *sb,
43 static int ext2_remount (struct super_block * sb, int * flags, char * data);
46 void ext2_error (struct super_block * sb, const char * function, in ext2_error() argument
50 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_error()
53 if (!(sb->s_flags & MS_RDONLY)) { in ext2_error()
56 ext2_sync_super(sb, es); in ext2_error()
60 printk(KERN_CRIT "EXT2-fs error (device %s): %s: ",sb->s_id, function); in ext2_error()
65 if (test_opt(sb, ERRORS_PANIC)) in ext2_error()
67 if (test_opt(sb, ERRORS_RO)) { in ext2_error()
69 sb->s_flags |= MS_RDONLY; in ext2_error()
73 void ext2_warning (struct super_block * sb, const char * function, in ext2_warning() argument
80 sb->s_id, function); in ext2_warning()
86 void ext2_update_dynamic_rev(struct super_block *sb) in ext2_update_dynamic_rev() argument
88 struct ext2_super_block *es = EXT2_SB(sb)->s_es; in ext2_update_dynamic_rev()
93 ext2_warning(sb, __func__, in ext2_update_dynamic_rev()
111 static void ext2_put_super (struct super_block * sb) in ext2_put_super() argument
115 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_put_super()
117 ext2_xattr_put_super(sb); in ext2_put_super()
118 if (!(sb->s_flags & MS_RDONLY)) { in ext2_put_super()
122 ext2_sync_super(sb, es); in ext2_put_super()
134 sb->s_fs_info = NULL; in ext2_put_super()
143 static struct inode *ext2_alloc_inode(struct super_block *sb) in ext2_alloc_inode() argument
215 struct super_block *sb = vfs->mnt_sb; in ext2_show_options() local
216 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_show_options()
224 if (test_opt(sb, MINIX_DF)) in ext2_show_options()
226 if (test_opt(sb, GRPID)) in ext2_show_options()
228 if (!test_opt(sb, GRPID) && (def_mount_opts & EXT2_DEFM_BSDGROUPS)) in ext2_show_options()
238 if (test_opt(sb, ERRORS_RO)) { in ext2_show_options()
246 if (test_opt(sb, ERRORS_CONT)) in ext2_show_options()
248 if (test_opt(sb, ERRORS_PANIC)) in ext2_show_options()
250 if (test_opt(sb, NO_UID32)) in ext2_show_options()
252 if (test_opt(sb, DEBUG)) in ext2_show_options()
254 if (test_opt(sb, OLDALLOC)) in ext2_show_options()
258 if (test_opt(sb, XATTR_USER)) in ext2_show_options()
260 if (!test_opt(sb, XATTR_USER) && in ext2_show_options()
267 if (test_opt(sb, POSIX_ACL)) in ext2_show_options()
269 if (!test_opt(sb, POSIX_ACL) && (def_mount_opts & EXT2_DEFM_ACL)) in ext2_show_options()
273 if (test_opt(sb, NOBH)) in ext2_show_options()
289 if (!test_opt(sb, RESERVATION)) in ext2_show_options()
296 static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off…
297 static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, lof…
317 static struct inode *ext2_nfs_get_inode(struct super_block *sb, in ext2_nfs_get_inode() argument
322 if (ino < EXT2_FIRST_INO(sb) && ino != EXT2_ROOT_INO) in ext2_nfs_get_inode()
324 if (ino > le32_to_cpu(EXT2_SB(sb)->s_es->s_inodes_count)) in ext2_nfs_get_inode()
332 inode = ext2_iget(sb, ino); in ext2_nfs_get_inode()
343 static struct dentry *ext2_fh_to_dentry(struct super_block *sb, struct fid *fid, in ext2_fh_to_dentry() argument
346 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in ext2_fh_to_dentry()
350 static struct dentry *ext2_fh_to_parent(struct super_block *sb, struct fid *fid, in ext2_fh_to_parent() argument
353 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in ext2_fh_to_parent()
577 static int ext2_setup_super (struct super_block * sb, in ext2_setup_super() argument
582 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_setup_super()
609 ext2_write_super(sb); in ext2_setup_super()
610 if (test_opt (sb, DEBUG)) in ext2_setup_super()
613 EXT2FS_VERSION, EXT2FS_DATE, sb->s_blocksize, in ext2_setup_super()
616 EXT2_BLOCKS_PER_GROUP(sb), in ext2_setup_super()
617 EXT2_INODES_PER_GROUP(sb), in ext2_setup_super()
622 static int ext2_check_descriptors(struct super_block *sb) in ext2_check_descriptors() argument
625 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_check_descriptors()
630 struct ext2_group_desc *gdp = ext2_get_group_desc(sb, i, NULL); in ext2_check_descriptors()
631 ext2_fsblk_t first_block = ext2_group_first_block_no(sb, i); in ext2_check_descriptors()
638 (EXT2_BLOCKS_PER_GROUP(sb) - 1); in ext2_check_descriptors()
643 ext2_error (sb, "ext2_check_descriptors", in ext2_check_descriptors()
652 ext2_error (sb, "ext2_check_descriptors", in ext2_check_descriptors()
662 ext2_error (sb, "ext2_check_descriptors", in ext2_check_descriptors()
719 static unsigned long descriptor_loc(struct super_block *sb, in descriptor_loc() argument
723 struct ext2_sb_info *sbi = EXT2_SB(sb); in descriptor_loc()
729 if (!EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_META_BG) || in descriptor_loc()
733 if (ext2_bg_has_super(sb, bg)) in descriptor_loc()
736 return ext2_group_first_block_no(sb, bg) + has_super; in descriptor_loc()
739 static int ext2_fill_super(struct super_block *sb, void *data, int silent) in ext2_fill_super() argument
767 sb->s_fs_info = sbi; in ext2_fill_super()
777 blocksize = sb_min_blocksize(sb, BLOCK_SIZE); in ext2_fill_super()
794 if (!(bh = sb_bread(sb, logic_sb_block))) { in ext2_fill_super()
804 sb->s_magic = le16_to_cpu(es->s_magic); in ext2_fill_super()
806 if (sb->s_magic != EXT2_SUPER_MAGIC) in ext2_fill_super()
841 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in ext2_fill_super()
842 ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? in ext2_fill_super()
845 ext2_xip_verify_sb(sb); /* see if bdev supports xip, unset in ext2_fill_super()
849 (EXT2_HAS_COMPAT_FEATURE(sb, ~0U) || in ext2_fill_super()
850 EXT2_HAS_RO_COMPAT_FEATURE(sb, ~0U) || in ext2_fill_super()
851 EXT2_HAS_INCOMPAT_FEATURE(sb, ~0U))) in ext2_fill_super()
859 features = EXT2_HAS_INCOMPAT_FEATURE(sb, ~EXT2_FEATURE_INCOMPAT_SUPP); in ext2_fill_super()
863 sb->s_id, le32_to_cpu(features)); in ext2_fill_super()
866 if (!(sb->s_flags & MS_RDONLY) && in ext2_fill_super()
867 (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){ in ext2_fill_super()
870 sb->s_id, le32_to_cpu(features)); in ext2_fill_super()
876 if (ext2_use_xip(sb) && blocksize != PAGE_SIZE) { in ext2_fill_super()
883 if (sb->s_blocksize != blocksize) { in ext2_fill_super()
886 if (!sb_set_blocksize(sb, blocksize)) { in ext2_fill_super()
893 bh = sb_bread(sb, logic_sb_block); in ext2_fill_super()
907 sb->s_maxbytes = ext2_max_size(sb->s_blocksize_bits); in ext2_fill_super()
928 sbi->s_frags_per_block = sb->s_blocksize / sbi->s_frag_size; in ext2_fill_super()
934 if (EXT2_INODE_SIZE(sb) == 0) in ext2_fill_super()
936 sbi->s_inodes_per_block = sb->s_blocksize / EXT2_INODE_SIZE(sb); in ext2_fill_super()
941 sbi->s_desc_per_block = sb->s_blocksize / in ext2_fill_super()
946 ilog2 (EXT2_ADDR_PER_BLOCK(sb)); in ext2_fill_super()
948 ilog2 (EXT2_DESC_PER_BLOCK(sb)); in ext2_fill_super()
950 if (sb->s_magic != EXT2_SUPER_MAGIC) in ext2_fill_super()
953 if (sb->s_blocksize != bh->b_size) { in ext2_fill_super()
956 "%s.\n", sb->s_id); 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()
971 if (sbi->s_frags_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
976 if (sbi->s_inodes_per_group > sb->s_blocksize * 8) { in ext2_fill_super()
982 if (EXT2_BLOCKS_PER_GROUP(sb) == 0) in ext2_fill_super()
986 / EXT2_BLOCKS_PER_GROUP(sb)) + 1; in ext2_fill_super()
987 db_count = (sbi->s_groups_count + EXT2_DESC_PER_BLOCK(sb) - 1) / in ext2_fill_super()
988 EXT2_DESC_PER_BLOCK(sb); in ext2_fill_super()
1001 block = descriptor_loc(sb, logic_sb_block, i); in ext2_fill_super()
1002 sbi->s_group_desc[i] = sb_bread(sb, block); in ext2_fill_super()
1010 if (!ext2_check_descriptors (sb)) { in ext2_fill_super()
1031 ext2_rsv_window_add(sb, &sbi->s_rsv_window_head); in ext2_fill_super()
1034 ext2_count_free_blocks(sb)); in ext2_fill_super()
1037 ext2_count_free_inodes(sb)); in ext2_fill_super()
1041 ext2_count_dirs(sb)); in ext2_fill_super()
1050 sb->s_op = &ext2_sops; in ext2_fill_super()
1051 sb->s_export_op = &ext2_export_ops; in ext2_fill_super()
1052 sb->s_xattr = ext2_xattr_handlers; in ext2_fill_super()
1053 root = ext2_iget(sb, EXT2_ROOT_INO); in ext2_fill_super()
1064 sb->s_root = d_alloc_root(root); in ext2_fill_super()
1065 if (!sb->s_root) { in ext2_fill_super()
1071 if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) in ext2_fill_super()
1072 ext2_warning(sb, __func__, in ext2_fill_super()
1074 ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY); in ext2_fill_super()
1080 sb->s_id); in ext2_fill_super()
1095 sb->s_fs_info = NULL; in ext2_fill_super()
1100 static void ext2_commit_super (struct super_block * sb, in ext2_commit_super() argument
1104 mark_buffer_dirty(EXT2_SB(sb)->s_sbh); in ext2_commit_super()
1105 sb->s_dirt = 0; in ext2_commit_super()
1108 static void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es) in ext2_sync_super() argument
1110 es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb)); in ext2_sync_super()
1111 es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb)); in ext2_sync_super()
1113 mark_buffer_dirty(EXT2_SB(sb)->s_sbh); in ext2_sync_super()
1114 sync_dirty_buffer(EXT2_SB(sb)->s_sbh); in ext2_sync_super()
1115 sb->s_dirt = 0; in ext2_sync_super()
1129 void ext2_write_super (struct super_block * sb) in ext2_write_super() argument
1133 if (!(sb->s_flags & MS_RDONLY)) { in ext2_write_super()
1134 es = EXT2_SB(sb)->s_es; in ext2_write_super()
1139 es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb)); in ext2_write_super()
1140 es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb)); in ext2_write_super()
1142 ext2_sync_super(sb, es); in ext2_write_super()
1144 ext2_commit_super (sb, es); in ext2_write_super()
1146 sb->s_dirt = 0; in ext2_write_super()
1150 static int ext2_remount (struct super_block * sb, int * flags, char * data) in ext2_remount() argument
1152 struct ext2_sb_info * sbi = EXT2_SB(sb); in ext2_remount()
1160 old_sb_flags = sb->s_flags; in ext2_remount()
1173 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in ext2_remount()
1176 ext2_xip_verify_sb(sb); /* see if bdev supports xip, unset in ext2_remount()
1179 if ((ext2_use_xip(sb)) && (sb->s_blocksize != PAGE_SIZE)) { in ext2_remount()
1188 invalidate_inodes(sb)) { in ext2_remount()
1189 ext2_warning(sb, __func__, "refusing change of xip flag " in ext2_remount()
1194 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) in ext2_remount()
1207 __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, in ext2_remount()
1212 sb->s_id, le32_to_cpu(ret)); in ext2_remount()
1222 if (!ext2_setup_super (sb, es, 0)) in ext2_remount()
1223 sb->s_flags &= ~MS_RDONLY; in ext2_remount()
1225 ext2_sync_super(sb, es); in ext2_remount()
1231 sb->s_flags = old_sb_flags; in ext2_remount()
1237 struct super_block *sb = dentry->d_sb; in ext2_statfs() local
1238 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_statfs()
1242 if (test_opt (sb, MINIX_DF)) in ext2_statfs()
1266 overhead += ext2_bg_has_super(sb, i) + in ext2_statfs()
1267 ext2_bg_num_gdb(sb, i); in ext2_statfs()
1281 buf->f_bsize = sb->s_blocksize; in ext2_statfs()
1283 buf->f_bfree = ext2_count_free_blocks(sb); in ext2_statfs()
1289 buf->f_ffree = ext2_count_free_inodes(sb); in ext2_statfs()
1311 static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, in ext2_quota_read() argument
1314 struct inode *inode = sb_dqopt(sb)->files[type]; in ext2_quota_read()
1315 sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb); in ext2_quota_read()
1317 int offset = off & (sb->s_blocksize - 1); in ext2_quota_read()
1330 tocopy = sb->s_blocksize - offset < toread ? in ext2_quota_read()
1331 sb->s_blocksize - offset : toread; in ext2_quota_read()
1340 bh = sb_bread(sb, tmp_bh.b_blocknr); in ext2_quota_read()
1355 static ssize_t ext2_quota_write(struct super_block *sb, int type, in ext2_quota_write() argument
1358 struct inode *inode = sb_dqopt(sb)->files[type]; in ext2_quota_write()
1359 sector_t blk = off >> EXT2_BLOCK_SIZE_BITS(sb); in ext2_quota_write()
1361 int offset = off & (sb->s_blocksize - 1); in ext2_quota_write()
1369 tocopy = sb->s_blocksize - offset < towrite ? in ext2_quota_write()
1370 sb->s_blocksize - offset : towrite; in ext2_quota_write()
1376 if (offset || tocopy != EXT2_BLOCK_SIZE(sb)) in ext2_quota_write()
1377 bh = sb_bread(sb, tmp_bh.b_blocknr); in ext2_quota_write()
1379 bh = sb_getblk(sb, tmp_bh.b_blocknr); in ext2_quota_write()