• Home
  • Raw
  • Download

Lines Matching refs:sb

71 static int nilfs_setup_super(struct super_block *sb, int is_mount);
72 static int nilfs_remount(struct super_block *sb, int *flags, char *data);
74 void __nilfs_msg(struct super_block *sb, const char *level, const char *fmt, in __nilfs_msg() argument
83 if (sb) in __nilfs_msg()
84 printk("%sNILFS (%s): %pV\n", level, sb->s_id, &vaf); in __nilfs_msg()
90 static void nilfs_set_error(struct super_block *sb) in nilfs_set_error() argument
92 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_set_error()
98 sbp = nilfs_prepare_super(sb, 0); in nilfs_set_error()
103 nilfs_commit_super(sb, NILFS_SB_COMMIT_ALL); in nilfs_set_error()
122 void __nilfs_error(struct super_block *sb, const char *function, in __nilfs_error() argument
125 struct the_nilfs *nilfs = sb->s_fs_info; in __nilfs_error()
135 sb->s_id, function, &vaf); in __nilfs_error()
139 if (!sb_rdonly(sb)) { in __nilfs_error()
140 nilfs_set_error(sb); in __nilfs_error()
144 sb->s_flags |= MS_RDONLY; in __nilfs_error()
150 sb->s_id); in __nilfs_error()
153 struct inode *nilfs_alloc_inode(struct super_block *sb) in nilfs_alloc_inode() argument
183 static int nilfs_sync_super(struct super_block *sb, int flag) in nilfs_sync_super() argument
185 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sync_super()
198 nilfs_msg(sb, KERN_ERR, "unable to write superblock: err=%d", in nilfs_sync_super()
257 struct nilfs_super_block **nilfs_prepare_super(struct super_block *sb, in nilfs_prepare_super() argument
260 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_prepare_super()
269 nilfs_msg(sb, KERN_CRIT, "superblock broke"); in nilfs_prepare_super()
283 int nilfs_commit_super(struct super_block *sb, int flag) in nilfs_commit_super() argument
285 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_commit_super()
308 return nilfs_sync_super(sb, flag); in nilfs_commit_super()
319 int nilfs_cleanup_super(struct super_block *sb) in nilfs_cleanup_super() argument
321 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_cleanup_super()
326 sbp = nilfs_prepare_super(sb, 0); in nilfs_cleanup_super()
339 ret = nilfs_commit_super(sb, flag); in nilfs_cleanup_super()
349 static int nilfs_move_2nd_super(struct super_block *sb, loff_t sb2off) in nilfs_move_2nd_super() argument
351 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_move_2nd_super()
377 nsbh = sb_getblk(sb, newblocknr); in nilfs_move_2nd_super()
379 nilfs_msg(sb, KERN_WARNING, in nilfs_move_2nd_super()
409 int nilfs_resize_fs(struct super_block *sb, __u64 newsize) in nilfs_resize_fs() argument
411 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_resize_fs()
418 devsize = i_size_read(sb->s_bdev->bd_inode); in nilfs_resize_fs()
438 ret = nilfs_construct_segment(sb); in nilfs_resize_fs()
443 nilfs_move_2nd_super(sb, sb2off); in nilfs_resize_fs()
445 sbp = nilfs_prepare_super(sb, 0); in nilfs_resize_fs()
459 ret = nilfs_commit_super(sb, NILFS_SB_COMMIT_ALL); in nilfs_resize_fs()
475 static void nilfs_put_super(struct super_block *sb) in nilfs_put_super() argument
477 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_put_super()
479 nilfs_detach_log_writer(sb); in nilfs_put_super()
481 if (!sb_rdonly(sb)) { in nilfs_put_super()
483 nilfs_cleanup_super(sb); in nilfs_put_super()
492 sb->s_fs_info = NULL; in nilfs_put_super()
495 static int nilfs_sync_fs(struct super_block *sb, int wait) in nilfs_sync_fs() argument
497 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sync_fs()
503 err = nilfs_construct_segment(sb); in nilfs_sync_fs()
507 sbp = nilfs_prepare_super(sb, nilfs_sb_will_flip(nilfs)); in nilfs_sync_fs()
510 nilfs_commit_super(sb, NILFS_SB_COMMIT); in nilfs_sync_fs()
521 int nilfs_attach_checkpoint(struct super_block *sb, __u64 cno, int curr_mnt, in nilfs_attach_checkpoint() argument
524 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_attach_checkpoint()
544 nilfs_msg(sb, KERN_ERR, in nilfs_attach_checkpoint()
552 err = nilfs_ifile_read(sb, root, nilfs->ns_inode_size, in nilfs_attach_checkpoint()
576 static int nilfs_freeze(struct super_block *sb) in nilfs_freeze() argument
578 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_freeze()
581 if (sb_rdonly(sb)) in nilfs_freeze()
586 err = nilfs_cleanup_super(sb); in nilfs_freeze()
591 static int nilfs_unfreeze(struct super_block *sb) in nilfs_unfreeze() argument
593 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_unfreeze()
595 if (sb_rdonly(sb)) in nilfs_unfreeze()
599 nilfs_setup_super(sb, false); in nilfs_unfreeze()
606 struct super_block *sb = dentry->d_sb; in nilfs_statfs() local
609 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in nilfs_statfs()
642 nilfs_msg(sb, KERN_WARNING, in nilfs_statfs()
659 buf->f_bsize = sb->s_blocksize; in nilfs_statfs()
675 struct super_block *sb = dentry->d_sb; in nilfs_show_options() local
676 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_show_options()
731 static int parse_options(char *options, struct super_block *sb, int is_remount) in parse_options() argument
733 struct the_nilfs *nilfs = sb->s_fs_info; in parse_options()
775 nilfs_msg(sb, KERN_ERR, in parse_options()
791 nilfs_msg(sb, KERN_ERR, in parse_options()
800 nilfs_set_default_options(struct super_block *sb, in nilfs_set_default_options() argument
803 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_set_default_options()
809 static int nilfs_setup_super(struct super_block *sb, int is_mount) in nilfs_setup_super() argument
811 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_setup_super()
817 sbp = nilfs_prepare_super(sb, 0); in nilfs_setup_super()
828 nilfs_msg(sb, KERN_WARNING, "mounting fs with errors"); in nilfs_setup_super()
831 nilfs_msg(sb, KERN_WARNING, "maximal mount count reached"); in nilfs_setup_super()
846 return nilfs_commit_super(sb, NILFS_SB_COMMIT_ALL); in nilfs_setup_super()
849 struct nilfs_super_block *nilfs_read_super_block(struct super_block *sb, in nilfs_read_super_block() argument
857 *pbh = sb_bread(sb, sb_index); in nilfs_read_super_block()
863 int nilfs_store_magic_and_option(struct super_block *sb, in nilfs_store_magic_and_option() argument
867 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_store_magic_and_option()
869 sb->s_magic = le16_to_cpu(sbp->s_magic); in nilfs_store_magic_and_option()
873 sb->s_flags |= MS_NOATIME; in nilfs_store_magic_and_option()
876 nilfs_set_default_options(sb, sbp); in nilfs_store_magic_and_option()
883 return !parse_options(data, sb, 0) ? -EINVAL : 0; in nilfs_store_magic_and_option()
886 int nilfs_check_feature_compatibility(struct super_block *sb, in nilfs_check_feature_compatibility() argument
894 nilfs_msg(sb, KERN_ERR, in nilfs_check_feature_compatibility()
901 if (!sb_rdonly(sb) && features) { in nilfs_check_feature_compatibility()
902 nilfs_msg(sb, KERN_ERR, in nilfs_check_feature_compatibility()
910 static int nilfs_get_root_dentry(struct super_block *sb, in nilfs_get_root_dentry() argument
918 inode = nilfs_iget(sb, root, NILFS_ROOT_INO); in nilfs_get_root_dentry()
921 nilfs_msg(sb, KERN_ERR, "error %d getting root inode", ret); in nilfs_get_root_dentry()
926 nilfs_msg(sb, KERN_ERR, "corrupt root inode"); in nilfs_get_root_dentry()
954 nilfs_msg(sb, KERN_ERR, "error %d getting root dentry", ret); in nilfs_get_root_dentry()
1007 int nilfs_checkpoint_is_mounted(struct super_block *sb, __u64 cno) in nilfs_checkpoint_is_mounted() argument
1009 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_checkpoint_is_mounted()
1024 inode = nilfs_ilookup(sb, root, NILFS_ROOT_INO); in nilfs_checkpoint_is_mounted()
1048 nilfs_fill_super(struct super_block *sb, void *data, int silent) in nilfs_fill_super() argument
1055 nilfs = alloc_nilfs(sb); in nilfs_fill_super()
1059 sb->s_fs_info = nilfs; in nilfs_fill_super()
1061 err = init_nilfs(nilfs, sb, (char *)data); in nilfs_fill_super()
1065 sb->s_op = &nilfs_sops; in nilfs_fill_super()
1066 sb->s_export_op = &nilfs_export_ops; in nilfs_fill_super()
1067 sb->s_root = NULL; in nilfs_fill_super()
1068 sb->s_time_gran = 1; in nilfs_fill_super()
1069 sb->s_max_links = NILFS_LINK_MAX; in nilfs_fill_super()
1071 sb->s_bdi = bdi_get(sb->s_bdev->bd_bdi); in nilfs_fill_super()
1073 err = load_nilfs(nilfs, sb); in nilfs_fill_super()
1078 err = nilfs_attach_checkpoint(sb, cno, true, &fsroot); in nilfs_fill_super()
1080 nilfs_msg(sb, KERN_ERR, in nilfs_fill_super()
1086 if (!sb_rdonly(sb)) { in nilfs_fill_super()
1087 err = nilfs_attach_log_writer(sb, fsroot); in nilfs_fill_super()
1092 err = nilfs_get_root_dentry(sb, fsroot, &sb->s_root); in nilfs_fill_super()
1098 if (!sb_rdonly(sb)) { in nilfs_fill_super()
1100 nilfs_setup_super(sb, true); in nilfs_fill_super()
1107 nilfs_detach_log_writer(sb); in nilfs_fill_super()
1122 static int nilfs_remount(struct super_block *sb, int *flags, char *data) in nilfs_remount() argument
1124 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_remount()
1129 sync_filesystem(sb); in nilfs_remount()
1130 old_sb_flags = sb->s_flags; in nilfs_remount()
1133 if (!parse_options(data, sb, 1)) { in nilfs_remount()
1137 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); in nilfs_remount()
1142 nilfs_msg(sb, KERN_WARNING, in nilfs_remount()
1147 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) in nilfs_remount()
1151 nilfs_detach_log_writer(sb); in nilfs_remount()
1152 sb->s_flags |= MS_RDONLY; in nilfs_remount()
1159 nilfs_cleanup_super(sb); in nilfs_remount()
1175 nilfs_msg(sb, KERN_WARNING, in nilfs_remount()
1182 sb->s_flags &= ~MS_RDONLY; in nilfs_remount()
1184 root = NILFS_I(d_inode(sb->s_root))->i_root; in nilfs_remount()
1185 err = nilfs_attach_log_writer(sb, root); in nilfs_remount()
1190 nilfs_setup_super(sb, true); in nilfs_remount()
1197 sb->s_flags = old_sb_flags; in nilfs_remount()