Lines Matching refs:sb
239 void f2fs_msg(struct super_block *sb, const char *level, const char *fmt, ...) in f2fs_msg() argument
247 printk("%sF2FS-fs (%s): %pV\n", level, sb->s_id, &vaf); in f2fs_msg()
258 static int parse_options(struct super_block *sb, char *options) in parse_options() argument
260 struct f2fs_sb_info *sbi = F2FS_SB(sb); in parse_options()
301 if (!f2fs_readonly(sb)) in parse_options()
322 f2fs_msg(sb, KERN_INFO, in parse_options()
326 f2fs_msg(sb, KERN_INFO, in parse_options()
330 f2fs_msg(sb, KERN_INFO, in parse_options()
343 f2fs_msg(sb, KERN_INFO, "acl options not supported"); in parse_options()
346 f2fs_msg(sb, KERN_INFO, "noacl options not supported"); in parse_options()
381 f2fs_msg(sb, KERN_ERR, in parse_options()
390 static struct inode *f2fs_alloc_inode(struct super_block *sb) in f2fs_alloc_inode() argument
413 if (test_opt(F2FS_SB(sb), INLINE_XATTR)) in f2fs_alloc_inode()
417 fi->i_dir_level = F2FS_SB(sb)->dir_level; in f2fs_alloc_inode()
457 static void f2fs_put_super(struct super_block *sb) in f2fs_put_super() argument
459 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_put_super()
463 remove_proc_entry(sb->s_id, f2fs_proc_root); in f2fs_put_super()
501 sb->s_fs_info = NULL; in f2fs_put_super()
506 int f2fs_sync_fs(struct super_block *sb, int sync) in f2fs_sync_fs() argument
508 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_sync_fs()
510 trace_f2fs_sync_fs(sb, sync); in f2fs_sync_fs()
528 static int f2fs_freeze(struct super_block *sb) in f2fs_freeze() argument
532 if (f2fs_readonly(sb)) in f2fs_freeze()
535 err = f2fs_sync_fs(sb, 1); in f2fs_freeze()
539 static int f2fs_unfreeze(struct super_block *sb) in f2fs_unfreeze() argument
546 struct super_block *sb = dentry->d_sb; in f2fs_statfs() local
547 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_statfs()
548 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in f2fs_statfs()
576 if (!f2fs_readonly(sbi->sb) && test_opt(sbi, BG_GC)) in f2fs_show_options()
608 if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE)) in f2fs_show_options()
623 struct super_block *sb = seq->private; in segment_info_seq_show() local
624 struct f2fs_sb_info *sbi = F2FS_SB(sb); in segment_info_seq_show()
661 static int f2fs_remount(struct super_block *sb, int *flags, char *data) in f2fs_remount() argument
663 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_remount()
669 sync_filesystem(sb); in f2fs_remount()
682 err = parse_options(sb, data); in f2fs_remount()
690 if (f2fs_readonly(sb) && (*flags & MS_RDONLY)) in f2fs_remount()
701 f2fs_sync_fs(sb, 1); in f2fs_remount()
724 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in f2fs_remount()
730 f2fs_msg(sbi->sb, KERN_WARNING, in f2fs_remount()
757 static struct inode *f2fs_nfs_get_inode(struct super_block *sb, in f2fs_nfs_get_inode() argument
760 struct f2fs_sb_info *sbi = F2FS_SB(sb); in f2fs_nfs_get_inode()
771 inode = f2fs_iget(sb, ino); in f2fs_nfs_get_inode()
782 static struct dentry *f2fs_fh_to_dentry(struct super_block *sb, struct fid *fid, in f2fs_fh_to_dentry() argument
785 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in f2fs_fh_to_dentry()
789 static struct dentry *f2fs_fh_to_parent(struct super_block *sb, struct fid *fid, in f2fs_fh_to_parent() argument
792 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in f2fs_fh_to_parent()
822 static int sanity_check_raw_super(struct super_block *sb, in sanity_check_raw_super() argument
828 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
836 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
845 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
856 f2fs_msg(sb, KERN_INFO, "Invalid log sectorsize (%u)", in sanity_check_raw_super()
863 f2fs_msg(sb, KERN_INFO, in sanity_check_raw_super()
889 f2fs_msg(sbi->sb, KERN_ERR, "A bug case: need to run fsck"); in sanity_check_ckpt()
930 static int read_raw_super_block(struct super_block *sb, in read_raw_super_block() argument
937 *raw_super_buf = sb_bread(sb, block); in read_raw_super_block()
939 f2fs_msg(sb, KERN_ERR, "Unable to read %dth superblock", in read_raw_super_block()
953 if (sanity_check_raw_super(sb, *raw_super)) { in read_raw_super_block()
955 f2fs_msg(sb, KERN_ERR, in read_raw_super_block()
969 static int f2fs_fill_super(struct super_block *sb, void *data, int silent) in f2fs_fill_super() argument
987 if (unlikely(!sb_set_blocksize(sb, F2FS_BLKSIZE))) { in f2fs_fill_super()
988 f2fs_msg(sb, KERN_ERR, "unable to set blocksize"); in f2fs_fill_super()
992 err = read_raw_super_block(sb, &raw_super, &raw_super_buf); in f2fs_fill_super()
996 sb->s_fs_info = sbi; in f2fs_fill_super()
1016 err = parse_options(sb, options); in f2fs_fill_super()
1020 sb->s_maxbytes = max_file_size(le32_to_cpu(raw_super->log_blocksize)); in f2fs_fill_super()
1021 sb->s_max_links = F2FS_LINK_MAX; in f2fs_fill_super()
1024 sb->s_op = &f2fs_sops; in f2fs_fill_super()
1025 sb->s_xattr = f2fs_xattr_handlers; in f2fs_fill_super()
1026 sb->s_export_op = &f2fs_export_ops; in f2fs_fill_super()
1027 sb->s_magic = F2FS_SUPER_MAGIC; in f2fs_fill_super()
1028 sb->s_time_gran = 1; in f2fs_fill_super()
1029 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | in f2fs_fill_super()
1031 memcpy(sb->s_uuid, raw_super->uuid, sizeof(raw_super->uuid)); in f2fs_fill_super()
1034 sbi->sb = sb; in f2fs_fill_super()
1058 sbi->meta_inode = f2fs_iget(sb, F2FS_META_INO(sbi)); in f2fs_fill_super()
1060 f2fs_msg(sb, KERN_ERR, "Failed to read F2FS meta data inode"); in f2fs_fill_super()
1067 f2fs_msg(sb, KERN_ERR, "Failed to get valid F2FS checkpoint"); in f2fs_fill_super()
1074 f2fs_msg(sb, KERN_ERR, "Invalid F2FS checkpoint"); in f2fs_fill_super()
1097 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1103 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1111 sbi->node_inode = f2fs_iget(sb, F2FS_NODE_INO(sbi)); in f2fs_fill_super()
1113 f2fs_msg(sb, KERN_ERR, "Failed to read node inode"); in f2fs_fill_super()
1122 root = f2fs_iget(sb, F2FS_ROOT_INO(sbi)); in f2fs_fill_super()
1124 f2fs_msg(sb, KERN_ERR, "Failed to read root inode"); in f2fs_fill_super()
1134 sb->s_root = d_make_root(root); /* allocate root dentry */ in f2fs_fill_super()
1135 if (!sb->s_root) { in f2fs_fill_super()
1145 sbi->s_proc = proc_mkdir(sb->s_id, f2fs_proc_root); in f2fs_fill_super()
1149 &f2fs_seq_segment_info_fops, sb); in f2fs_fill_super()
1152 struct request_queue *q = bdev_get_queue(sb->s_bdev); in f2fs_fill_super()
1154 f2fs_msg(sb, KERN_WARNING, in f2fs_fill_super()
1162 "%s", sb->s_id); in f2fs_fill_super()
1172 if (bdev_read_only(sb->s_bdev) && in f2fs_fill_super()
1184 f2fs_msg(sb, KERN_ERR, in f2fs_fill_super()
1194 if (test_opt(sbi, BG_GC) && !f2fs_readonly(sb)) { in f2fs_fill_super()
1208 remove_proc_entry(sb->s_id, f2fs_proc_root); in f2fs_fill_super()
1212 dput(sb->s_root); in f2fs_fill_super()
1213 sb->s_root = NULL; in f2fs_fill_super()
1235 shrink_dcache_sb(sb); in f2fs_fill_super()
1247 static void kill_f2fs_super(struct super_block *sb) in kill_f2fs_super() argument
1249 if (sb->s_root) in kill_f2fs_super()
1250 set_sbi_flag(F2FS_SB(sb), SBI_IS_CLOSE); in kill_f2fs_super()
1251 kill_block_super(sb); in kill_f2fs_super()