Lines Matching full:dir
353 struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir, in f2fs_find_in_inline_dir() argument
357 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); in f2fs_find_in_inline_dir()
363 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_find_in_inline_dir()
369 inline_dentry = inline_data_addr(dir, ipage); in f2fs_find_in_inline_dir()
371 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_find_in_inline_dir()
409 static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, in f2fs_move_inline_dirents() argument
418 page = f2fs_grab_cache_page(dir->i_mapping, 0, true); in f2fs_move_inline_dirents()
424 set_new_dnode(&dn, dir, ipage, NULL, 0); in f2fs_move_inline_dirents()
433 __func__, dir->i_ino, dn.data_blkaddr); in f2fs_move_inline_dirents()
449 make_dentry_ptr_inline(dir, &src, inline_dentry); in f2fs_move_inline_dirents()
450 make_dentry_ptr_block(dir, &dst, dentry_blk); in f2fs_move_inline_dirents()
461 /* clear inline dir and flag after data writeback */ in f2fs_move_inline_dirents()
462 f2fs_truncate_inline_inode(dir, ipage, 0); in f2fs_move_inline_dirents()
464 stat_dec_inline_dir(dir); in f2fs_move_inline_dirents()
465 clear_inode_flag(dir, FI_INLINE_DENTRY); in f2fs_move_inline_dirents()
471 if (!f2fs_sb_has_flexible_inline_xattr(F2FS_I_SB(dir)) && in f2fs_move_inline_dirents()
472 !f2fs_has_inline_xattr(dir)) in f2fs_move_inline_dirents()
473 F2FS_I(dir)->i_inline_xattr_size = 0; in f2fs_move_inline_dirents()
475 f2fs_i_depth_write(dir, 1); in f2fs_move_inline_dirents()
476 if (i_size_read(dir) < PAGE_SIZE) in f2fs_move_inline_dirents()
477 f2fs_i_size_write(dir, PAGE_SIZE); in f2fs_move_inline_dirents()
483 static int f2fs_add_inline_entries(struct inode *dir, void *inline_dentry) in f2fs_add_inline_entries() argument
489 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_add_inline_entries()
521 err = f2fs_add_regular_entry(dir, &fname, NULL, ino, fake_mode); in f2fs_add_inline_entries()
529 truncate_inode_pages(&dir->i_data, 0); in f2fs_add_inline_entries()
530 f2fs_truncate_blocks(dir, 0, false); in f2fs_add_inline_entries()
531 f2fs_remove_dirty_inode(dir); in f2fs_add_inline_entries()
535 static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage, in f2fs_move_rehashed_dirents() argument
541 backup_dentry = f2fs_kmalloc(F2FS_I_SB(dir), in f2fs_move_rehashed_dirents()
542 MAX_INLINE_DATA(dir), GFP_F2FS_ZERO); in f2fs_move_rehashed_dirents()
548 memcpy(backup_dentry, inline_dentry, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
549 f2fs_truncate_inline_inode(dir, ipage, 0); in f2fs_move_rehashed_dirents()
553 err = f2fs_add_inline_entries(dir, backup_dentry); in f2fs_move_rehashed_dirents()
559 stat_dec_inline_dir(dir); in f2fs_move_rehashed_dirents()
560 clear_inode_flag(dir, FI_INLINE_DENTRY); in f2fs_move_rehashed_dirents()
566 if (!f2fs_sb_has_flexible_inline_xattr(F2FS_I_SB(dir)) && in f2fs_move_rehashed_dirents()
567 !f2fs_has_inline_xattr(dir)) in f2fs_move_rehashed_dirents()
568 F2FS_I(dir)->i_inline_xattr_size = 0; in f2fs_move_rehashed_dirents()
575 memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
576 f2fs_i_depth_write(dir, 0); in f2fs_move_rehashed_dirents()
577 f2fs_i_size_write(dir, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
585 static int do_convert_inline_dir(struct inode *dir, struct page *ipage, in do_convert_inline_dir() argument
588 if (!F2FS_I(dir)->i_dir_level) in do_convert_inline_dir()
589 return f2fs_move_inline_dirents(dir, ipage, inline_dentry); in do_convert_inline_dir()
591 return f2fs_move_rehashed_dirents(dir, ipage, inline_dentry); in do_convert_inline_dir()
594 int f2fs_try_convert_inline_dir(struct inode *dir, struct dentry *dentry) in f2fs_try_convert_inline_dir() argument
596 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_try_convert_inline_dir()
602 if (!f2fs_has_inline_dentry(dir)) in f2fs_try_convert_inline_dir()
607 err = f2fs_setup_filename(dir, &dentry->d_name, 0, &fname); in f2fs_try_convert_inline_dir()
611 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_try_convert_inline_dir()
617 if (f2fs_has_enough_room(dir, ipage, &fname)) { in f2fs_try_convert_inline_dir()
622 inline_dentry = inline_data_addr(dir, ipage); in f2fs_try_convert_inline_dir()
624 err = do_convert_inline_dir(dir, ipage, inline_dentry); in f2fs_try_convert_inline_dir()
634 int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname, in f2fs_add_inline_entry() argument
637 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_add_inline_entry()
646 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_add_inline_entry()
650 inline_dentry = inline_data_addr(dir, ipage); in f2fs_add_inline_entry()
651 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_add_inline_entry()
655 err = do_convert_inline_dir(dir, ipage, inline_dentry); in f2fs_add_inline_entry()
665 page = f2fs_init_inode_metadata(inode, dir, fname, ipage); in f2fs_add_inline_entry()
681 f2fs_i_pino_write(inode, dir->i_ino); in f2fs_add_inline_entry()
690 f2fs_update_parent_metadata(dir, inode, 0); in f2fs_add_inline_entry()
700 struct inode *dir, struct inode *inode) in f2fs_delete_inline_entry() argument
711 inline_dentry = inline_data_addr(dir, page); in f2fs_delete_inline_entry()
712 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_delete_inline_entry()
721 inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); in f2fs_delete_inline_entry()
722 f2fs_mark_inode_dirty_sync(dir, false); in f2fs_delete_inline_entry()
725 f2fs_drop_nlink(dir, inode); in f2fs_delete_inline_entry()
728 bool f2fs_empty_inline_dir(struct inode *dir) in f2fs_empty_inline_dir() argument
730 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_empty_inline_dir()
736 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_empty_inline_dir()
740 inline_dentry = inline_data_addr(dir, ipage); in f2fs_empty_inline_dir()
741 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_empty_inline_dir()