Lines Matching refs:sb
252 void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...) in f2fs_msg() argument
260 printk("%sF2FS-fs (%s): %pV\n", level, sb->s_id, &vaf); in f2fs_msg()
271 static int parse_options(struct super_block *sb, char *options) in parse_options() argument
273 struct f2fs_sb_info *sbi = F2FS_SB(sb); in parse_options()
320 if (!f2fs_readonly(sb)) in parse_options()
324 q = bdev_get_queue(sb->s_bdev); in parse_options()
328 f2fs_msg(sb, KERN_WARNING, in parse_options()
348 f2fs_msg(sb, KERN_INFO, in parse_options()
352 f2fs_msg(sb, KERN_INFO, in parse_options()
356 f2fs_msg(sb, KERN_INFO, in parse_options()
369 f2fs_msg(sb, KERN_INFO, "acl options not supported"); in parse_options()
372 f2fs_msg(sb, KERN_INFO, "noacl options not supported"); in parse_options()
410 f2fs_msg(sb, KERN_ERR, in parse_options()
419 static struct inode *f2fs_alloc_inode(struct super_block *sb) in f2fs_alloc_inode() argument
440 if (test_opt(F2FS_SB(sb), INLINE_XATTR)) in f2fs_alloc_inode()
444 fi->i_dir_level = F2FS_SB(sb)->dir_level; in f2fs_alloc_inode()
516 static void f2fs_put_super(struct super_block *sb) in f2fs_put_super() argument
518 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_put_super()
522 remove_proc_entry(sb->s_id, f2fs_proc_root); in f2fs_put_super()
568 sb->s_fs_info = NULL; in f2fs_put_super()
573 int f2fs_sync_fs(struct super_block *sb, int sync) in f2fs_sync_fs() argument
575 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_sync_fs()
577 trace_f2fs_sync_fs(sb, sync); in f2fs_sync_fs()
595 static int f2fs_freeze(struct super_block *sb) in f2fs_freeze() argument
599 if (f2fs_readonly(sb)) in f2fs_freeze()
602 err = f2fs_sync_fs(sb, 1); in f2fs_freeze()
606 static int f2fs_unfreeze(struct super_block *sb) in f2fs_unfreeze() argument
613 struct super_block *sb = dentry->d_sb; in f2fs_statfs() local
614 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_statfs()
615 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in f2fs_statfs()
643 if (!f2fs_readonly(sbi->sb) && test_opt(sbi, BG_GC)) { in f2fs_show_options()
679 if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE)) in f2fs_show_options()
696 struct super_block *sb = seq->private; in segment_info_seq_show() local
697 struct f2fs_sb_info *sbi = F2FS_SB(sb); in segment_info_seq_show()
751 static int f2fs_remount(struct super_block *sb, int *flags, char *data) in f2fs_remount() argument
753 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_remount()
760 sync_filesystem(sb); in f2fs_remount()
773 err = parse_options(sb, data); in f2fs_remount()
781 if (f2fs_readonly(sb) && (*flags & MS_RDONLY)) in f2fs_remount()
787 f2fs_msg(sbi->sb, KERN_WARNING, in f2fs_remount()
800 f2fs_sync_fs(sb, 1); in f2fs_remount()
823 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in f2fs_remount()
829 f2fs_msg(sbi->sb, KERN_WARNING, in f2fs_remount()
856 static struct inode *f2fs_nfs_get_inode(struct super_block *sb, in f2fs_nfs_get_inode() argument
859 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_nfs_get_inode()
870 inode = f2fs_iget(sb, ino); in f2fs_nfs_get_inode()
881 static struct dentry *f2fs_fh_to_dentry(struct super_block *sb, struct fid *fid, in f2fs_fh_to_dentry() argument
884 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in f2fs_fh_to_dentry()
888 static struct dentry *f2fs_fh_to_parent(struct super_block *sb, struct fid *fid, in f2fs_fh_to_parent() argument
891 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in f2fs_fh_to_parent()
921 static int sanity_check_raw_super(struct super_block *sb, in sanity_check_raw_super() argument
927 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
935 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
944 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
955 f2fs_msg(sb, KERN_INFO, "Invalid log sectorsize (%u)", in sanity_check_raw_super()
962 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
988 f2fs_msg(sbi->sb, KERN_ERR, "A bug case: need to run fsck"); in sanity_check_ckpt()
1033 static int read_raw_super_block(struct super_block *sb, in read_raw_super_block() argument
1044 buffer = sb_bread(sb, block); in read_raw_super_block()
1047 f2fs_msg(sb, KERN_ERR, "Unable to read %dth superblock", in read_raw_super_block()
1062 if (sanity_check_raw_super(sb, super)) { in read_raw_super_block()
1065 f2fs_msg(sb, KERN_ERR, in read_raw_super_block()
1125 static int f2fs_fill_super(struct super_block *sb, void *data, int silent) in f2fs_fill_super() argument
1148 if (unlikely(!sb_set_blocksize(sb, F2FS_BLKSIZE))) { in f2fs_fill_super()
1149 f2fs_msg(sb, KERN_ERR, "unable to set blocksize"); in f2fs_fill_super()
1153 err = read_raw_super_block(sb, &raw_super, &raw_super_buf, &recovery); in f2fs_fill_super()
1157 sb->s_fs_info = sbi; in f2fs_fill_super()
1166 err = parse_options(sb, options); in f2fs_fill_super()
1170 sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize)); in f2fs_fill_super()
1171 sb->s_max_links = F2FS_LINK_MAX; in f2fs_fill_super()
1174 sb->s_op = &f2fs_sops; in f2fs_fill_super()
1175 sb->s_xattr = f2fs_xattr_handlers; in f2fs_fill_super()
1176 sb->s_export_op = &f2fs_export_ops; in f2fs_fill_super()
1177 sb->s_magic = F2FS_SUPER_MAGIC; in f2fs_fill_super()
1178 sb->s_time_gran = 1; in f2fs_fill_super()
1179 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in f2fs_fill_super()
1181 memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid)); in f2fs_fill_super()
1184 sbi->sb = sb; in f2fs_fill_super()
1210 sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi)); in f2fs_fill_super()
1212 f2fs_msg(sb, KERN_ERR, "Failed to read F2FS meta data inode"); in f2fs_fill_super()
1219 f2fs_msg(sb, KERN_ERR, "Failed to get valid F2FS checkpoint"); in f2fs_fill_super()
1226 f2fs_msg(sb, KERN_ERR, "Invalid F2FS checkpoint"); in f2fs_fill_super()
1249 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1255 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1263 sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi)); in f2fs_fill_super()
1265 f2fs_msg(sb, KERN_ERR, "Failed to read node inode"); in f2fs_fill_super()
1278 root = f2fs_iget(sb, F2FS_ROOT_INO(sbi)); in f2fs_fill_super()
1280 f2fs_msg(sb, KERN_ERR, "Failed to read root inode"); in f2fs_fill_super()
1290 sb->s_root = d_make_root(root); /* allocate root dentry */ in f2fs_fill_super()
1291 if (!sb->s_root) { in f2fs_fill_super()
1301 sbi->s_proc = proc_mkdir(sb->s_id, f2fs_proc_root); in f2fs_fill_super()
1305 &f2fs_seq_segment_info_fops, sb); in f2fs_fill_super()
1310 "%s", sb->s_id); in f2fs_fill_super()
1320 if (bdev_read_only(sb->s_bdev) && in f2fs_fill_super()
1332 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1344 if (test_opt(sbi, BG_GC) && !f2fs_readonly(sb)) { in f2fs_fill_super()
1353 if (recovery && !f2fs_readonly(sb) && !bdev_read_only(sb->s_bdev)) { in f2fs_fill_super()
1354 f2fs_msg(sb, KERN_INFO, "Recover invalid superblock"); in f2fs_fill_super()
1367 remove_proc_entry(sb->s_id, f2fs_proc_root); in f2fs_fill_super()
1371 dput(sb->s_root); in f2fs_fill_super()
1372 sb->s_root = NULL; in f2fs_fill_super()
1397 shrink_dcache_sb(sb); in f2fs_fill_super()
1409 static void kill_f2fs_super(struct super_block *sb) in kill_f2fs_super() argument
1411 if (sb->s_root) in kill_f2fs_super()
1412 set_sbi_flag(F2FS_SB(sb), SBI_IS_CLOSE); in kill_f2fs_super()
1413 kill_block_super(sb); in kill_f2fs_super()