Lines Matching refs:sbi

73 int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,  in f2fs_update_extension_list()  argument
76 __u8 (*extlist)[F2FS_EXTENSION_LEN] = sbi->raw_super->extension_list; in f2fs_update_extension_list()
77 int cold_count = le32_to_cpu(sbi->raw_super->extension_count); in f2fs_update_extension_list()
78 int hot_count = sbi->raw_super->hot_ext_count; in f2fs_update_extension_list()
112 sbi->raw_super->hot_ext_count = hot_count - 1; in f2fs_update_extension_list()
114 sbi->raw_super->extension_count = in f2fs_update_extension_list()
124 sbi->raw_super->hot_ext_count = hot_count + 1; in f2fs_update_extension_list()
134 sbi->raw_super->extension_count = cpu_to_le32(cold_count + 1); in f2fs_update_extension_list()
139 static void set_compress_new_inode(struct f2fs_sb_info *sbi, struct inode *dir, in set_compress_new_inode() argument
142 __u8 (*extlist)[F2FS_EXTENSION_LEN] = sbi->raw_super->extension_list; in set_compress_new_inode()
144 F2FS_OPTION(sbi).noextensions; in set_compress_new_inode()
145 unsigned char (*ext)[F2FS_EXTENSION_LEN] = F2FS_OPTION(sbi).extensions; in set_compress_new_inode()
146 unsigned char ext_cnt = F2FS_OPTION(sbi).compress_ext_cnt; in set_compress_new_inode()
147 unsigned char noext_cnt = F2FS_OPTION(sbi).nocompress_ext_cnt; in set_compress_new_inode()
150 if (!f2fs_sb_has_compression(sbi)) in set_compress_new_inode()
161 f2fs_down_read(&sbi->sb_lock); in set_compress_new_inode()
162 cold_count = le32_to_cpu(sbi->raw_super->extension_count); in set_compress_new_inode()
163 hot_count = sbi->raw_super->hot_ext_count; in set_compress_new_inode()
167 f2fs_up_read(&sbi->sb_lock); in set_compress_new_inode()
196 static void set_file_temperature(struct f2fs_sb_info *sbi, struct inode *inode, in set_file_temperature() argument
199 __u8 (*extlist)[F2FS_EXTENSION_LEN] = sbi->raw_super->extension_list; in set_file_temperature()
202 f2fs_down_read(&sbi->sb_lock); in set_file_temperature()
203 cold_count = le32_to_cpu(sbi->raw_super->extension_count); in set_file_temperature()
204 hot_count = sbi->raw_super->hot_ext_count; in set_file_temperature()
208 f2fs_up_read(&sbi->sb_lock); in set_file_temperature()
223 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_new_inode() local
236 if (!f2fs_alloc_nid(sbi, &ino)) { in f2fs_new_inode()
261 if (f2fs_sb_has_project_quota(sbi) && in f2fs_new_inode()
281 if (f2fs_sb_has_extra_attr(sbi)) { in f2fs_new_inode()
286 if (test_opt(sbi, INLINE_XATTR)) in f2fs_new_inode()
292 if (f2fs_sb_has_flexible_inline_xattr(sbi)) { in f2fs_new_inode()
293 f2fs_bug_on(sbi, !f2fs_has_extra_attr(inode)); in f2fs_new_inode()
295 xattr_size = F2FS_OPTION(sbi).inline_xattr_size; in f2fs_new_inode()
313 set_compress_new_inode(sbi, dir, inode, name); in f2fs_new_inode()
316 if (test_opt(sbi, INLINE_DATA) && f2fs_may_inline_data(inode)) in f2fs_new_inode()
319 if (name && !test_opt(sbi, DISABLE_EXT_IDENTIFY)) in f2fs_new_inode()
320 set_file_temperature(sbi, inode, name); in f2fs_new_inode()
355 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_create() local
360 if (unlikely(f2fs_cp_error(sbi))) in f2fs_create()
362 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_create()
378 f2fs_lock_op(sbi); in f2fs_create()
382 f2fs_unlock_op(sbi); in f2fs_create()
384 f2fs_alloc_nid_done(sbi, ino); in f2fs_create()
389 f2fs_sync_fs(sbi->sb, 1); in f2fs_create()
391 f2fs_balance_fs(sbi, true); in f2fs_create()
402 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_link() local
405 if (unlikely(f2fs_cp_error(sbi))) in f2fs_link()
407 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_link()
423 f2fs_balance_fs(sbi, true); in f2fs_link()
429 f2fs_lock_op(sbi); in f2fs_link()
433 f2fs_unlock_op(sbi); in f2fs_link()
438 f2fs_sync_fs(sbi->sb, 1); in f2fs_link()
443 f2fs_unlock_op(sbi); in f2fs_link()
536 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_unlink() local
544 if (unlikely(f2fs_cp_error(sbi))) { in f2fs_unlink()
563 f2fs_balance_fs(sbi, true); in f2fs_unlink()
565 f2fs_lock_op(sbi); in f2fs_unlink()
566 err = f2fs_acquire_orphan_inode(sbi); in f2fs_unlink()
568 f2fs_unlock_op(sbi); in f2fs_unlink()
573 f2fs_unlock_op(sbi); in f2fs_unlink()
585 f2fs_sync_fs(sbi->sb, 1); in f2fs_unlink()
609 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_symlink() local
615 if (unlikely(f2fs_cp_error(sbi))) in f2fs_symlink()
617 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_symlink()
640 f2fs_lock_op(sbi); in f2fs_symlink()
644 f2fs_unlock_op(sbi); in f2fs_symlink()
645 f2fs_alloc_nid_done(sbi, inode->i_ino); in f2fs_symlink()
670 f2fs_sync_fs(sbi->sb, 1); in f2fs_symlink()
675 f2fs_balance_fs(sbi, true); in f2fs_symlink()
689 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_mkdir() local
693 if (unlikely(f2fs_cp_error(sbi))) in f2fs_mkdir()
710 f2fs_lock_op(sbi); in f2fs_mkdir()
714 f2fs_unlock_op(sbi); in f2fs_mkdir()
716 f2fs_alloc_nid_done(sbi, inode->i_ino); in f2fs_mkdir()
721 f2fs_sync_fs(sbi->sb, 1); in f2fs_mkdir()
723 f2fs_balance_fs(sbi, true); in f2fs_mkdir()
744 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_mknod() local
748 if (unlikely(f2fs_cp_error(sbi))) in f2fs_mknod()
750 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_mknod()
764 f2fs_lock_op(sbi); in f2fs_mknod()
768 f2fs_unlock_op(sbi); in f2fs_mknod()
770 f2fs_alloc_nid_done(sbi, inode->i_ino); in f2fs_mknod()
775 f2fs_sync_fs(sbi->sb, 1); in f2fs_mknod()
777 f2fs_balance_fs(sbi, true); in f2fs_mknod()
788 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in __f2fs_tmpfile() local
809 f2fs_lock_op(sbi); in __f2fs_tmpfile()
810 err = f2fs_acquire_orphan_inode(sbi); in __f2fs_tmpfile()
823 f2fs_alloc_nid_done(sbi, inode->i_ino); in __f2fs_tmpfile()
838 f2fs_unlock_op(sbi); in __f2fs_tmpfile()
844 f2fs_balance_fs(sbi, true); in __f2fs_tmpfile()
848 f2fs_release_orphan_inode(sbi); in __f2fs_tmpfile()
857 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_tmpfile() local
860 if (unlikely(f2fs_cp_error(sbi))) in f2fs_tmpfile()
862 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_tmpfile()
889 struct f2fs_sb_info *sbi = F2FS_I_SB(old_dir); in f2fs_rename() local
901 if (unlikely(f2fs_cp_error(sbi))) in f2fs_rename()
903 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_rename()
984 f2fs_balance_fs(sbi, true); in f2fs_rename()
986 f2fs_lock_op(sbi); in f2fs_rename()
988 err = f2fs_acquire_orphan_inode(sbi); in f2fs_rename()
1005 f2fs_release_orphan_inode(sbi); in f2fs_rename()
1007 f2fs_balance_fs(sbi, true); in f2fs_rename()
1009 f2fs_lock_op(sbi); in f2fs_rename()
1013 f2fs_unlock_op(sbi); in f2fs_rename()
1053 if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) { in f2fs_rename()
1054 f2fs_add_ino_entry(sbi, new_dir->i_ino, TRANS_DIR_INO); in f2fs_rename()
1056 f2fs_add_ino_entry(sbi, old_inode->i_ino, in f2fs_rename()
1060 f2fs_unlock_op(sbi); in f2fs_rename()
1063 f2fs_sync_fs(sbi->sb, 1); in f2fs_rename()
1065 f2fs_update_time(sbi, REQ_TIME); in f2fs_rename()
1069 f2fs_unlock_op(sbi); in f2fs_rename()
1084 struct f2fs_sb_info *sbi = F2FS_I_SB(old_dir); in f2fs_cross_rename() local
1094 if (unlikely(f2fs_cp_error(sbi))) in f2fs_cross_rename()
1096 if (!f2fs_is_checkpoint_ready(sbi)) in f2fs_cross_rename()
1168 f2fs_balance_fs(sbi, true); in f2fs_cross_rename()
1170 f2fs_lock_op(sbi); in f2fs_cross_rename()
1218 if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) { in f2fs_cross_rename()
1219 f2fs_add_ino_entry(sbi, old_dir->i_ino, TRANS_DIR_INO); in f2fs_cross_rename()
1220 f2fs_add_ino_entry(sbi, new_dir->i_ino, TRANS_DIR_INO); in f2fs_cross_rename()
1223 f2fs_unlock_op(sbi); in f2fs_cross_rename()
1226 f2fs_sync_fs(sbi->sb, 1); in f2fs_cross_rename()
1228 f2fs_update_time(sbi, REQ_TIME); in f2fs_cross_rename()