Lines Matching full:dir

354 struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,  in f2fs_find_in_inline_dir()  argument
358 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); in f2fs_find_in_inline_dir()
364 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_find_in_inline_dir()
370 inline_dentry = inline_data_addr(dir, ipage); in f2fs_find_in_inline_dir()
372 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_find_in_inline_dir()
410 static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, in f2fs_move_inline_dirents() argument
419 page = f2fs_grab_cache_page(dir->i_mapping, 0, true); in f2fs_move_inline_dirents()
425 set_new_dnode(&dn, dir, ipage, NULL, 0); in f2fs_move_inline_dirents()
434 __func__, dir->i_ino, dn.data_blkaddr); in f2fs_move_inline_dirents()
450 make_dentry_ptr_inline(dir, &src, inline_dentry); in f2fs_move_inline_dirents()
451 make_dentry_ptr_block(dir, &dst, dentry_blk); in f2fs_move_inline_dirents()
462 /* clear inline dir and flag after data writeback */ in f2fs_move_inline_dirents()
463 f2fs_truncate_inline_inode(dir, ipage, 0); in f2fs_move_inline_dirents()
465 stat_dec_inline_dir(dir); in f2fs_move_inline_dirents()
466 clear_inode_flag(dir, FI_INLINE_DENTRY); in f2fs_move_inline_dirents()
472 if (!f2fs_sb_has_flexible_inline_xattr(F2FS_I_SB(dir)) && in f2fs_move_inline_dirents()
473 !f2fs_has_inline_xattr(dir)) in f2fs_move_inline_dirents()
474 F2FS_I(dir)->i_inline_xattr_size = 0; in f2fs_move_inline_dirents()
476 f2fs_i_depth_write(dir, 1); in f2fs_move_inline_dirents()
477 if (i_size_read(dir) < PAGE_SIZE) in f2fs_move_inline_dirents()
478 f2fs_i_size_write(dir, PAGE_SIZE); in f2fs_move_inline_dirents()
484 static int f2fs_add_inline_entries(struct inode *dir, void *inline_dentry) in f2fs_add_inline_entries() argument
490 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_add_inline_entries()
522 err = f2fs_add_regular_entry(dir, &fname, NULL, ino, fake_mode); in f2fs_add_inline_entries()
530 truncate_inode_pages(&dir->i_data, 0); in f2fs_add_inline_entries()
531 f2fs_truncate_blocks(dir, 0, false); in f2fs_add_inline_entries()
532 f2fs_remove_dirty_inode(dir); in f2fs_add_inline_entries()
536 static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage, in f2fs_move_rehashed_dirents() argument
542 backup_dentry = f2fs_kmalloc(F2FS_I_SB(dir), in f2fs_move_rehashed_dirents()
543 MAX_INLINE_DATA(dir), GFP_F2FS_ZERO); in f2fs_move_rehashed_dirents()
549 memcpy(backup_dentry, inline_dentry, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
550 f2fs_truncate_inline_inode(dir, ipage, 0); in f2fs_move_rehashed_dirents()
554 err = f2fs_add_inline_entries(dir, backup_dentry); in f2fs_move_rehashed_dirents()
560 stat_dec_inline_dir(dir); in f2fs_move_rehashed_dirents()
561 clear_inode_flag(dir, FI_INLINE_DENTRY); in f2fs_move_rehashed_dirents()
567 if (!f2fs_sb_has_flexible_inline_xattr(F2FS_I_SB(dir)) && in f2fs_move_rehashed_dirents()
568 !f2fs_has_inline_xattr(dir)) in f2fs_move_rehashed_dirents()
569 F2FS_I(dir)->i_inline_xattr_size = 0; in f2fs_move_rehashed_dirents()
576 memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
577 f2fs_i_depth_write(dir, 0); in f2fs_move_rehashed_dirents()
578 f2fs_i_size_write(dir, MAX_INLINE_DATA(dir)); in f2fs_move_rehashed_dirents()
586 static int do_convert_inline_dir(struct inode *dir, struct page *ipage, in do_convert_inline_dir() argument
589 if (!F2FS_I(dir)->i_dir_level) in do_convert_inline_dir()
590 return f2fs_move_inline_dirents(dir, ipage, inline_dentry); in do_convert_inline_dir()
592 return f2fs_move_rehashed_dirents(dir, ipage, inline_dentry); in do_convert_inline_dir()
595 int f2fs_try_convert_inline_dir(struct inode *dir, struct dentry *dentry) in f2fs_try_convert_inline_dir() argument
597 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_try_convert_inline_dir()
603 if (!f2fs_has_inline_dentry(dir)) in f2fs_try_convert_inline_dir()
608 err = f2fs_setup_filename(dir, &dentry->d_name, 0, &fname); in f2fs_try_convert_inline_dir()
612 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_try_convert_inline_dir()
618 if (f2fs_has_enough_room(dir, ipage, &fname)) { in f2fs_try_convert_inline_dir()
623 inline_dentry = inline_data_addr(dir, ipage); in f2fs_try_convert_inline_dir()
625 err = do_convert_inline_dir(dir, ipage, inline_dentry); in f2fs_try_convert_inline_dir()
635 int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname, in f2fs_add_inline_entry() argument
638 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_add_inline_entry()
647 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_add_inline_entry()
651 inline_dentry = inline_data_addr(dir, ipage); in f2fs_add_inline_entry()
652 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_add_inline_entry()
656 err = do_convert_inline_dir(dir, ipage, inline_dentry); in f2fs_add_inline_entry()
666 page = f2fs_init_inode_metadata(inode, dir, fname, ipage); in f2fs_add_inline_entry()
682 f2fs_i_pino_write(inode, dir->i_ino); in f2fs_add_inline_entry()
691 f2fs_update_parent_metadata(dir, inode, 0); in f2fs_add_inline_entry()
701 struct inode *dir, struct inode *inode) in f2fs_delete_inline_entry() argument
712 inline_dentry = inline_data_addr(dir, page); in f2fs_delete_inline_entry()
713 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_delete_inline_entry()
722 dir->i_mtime = inode_set_ctime_current(dir); in f2fs_delete_inline_entry()
723 f2fs_mark_inode_dirty_sync(dir, false); in f2fs_delete_inline_entry()
726 f2fs_drop_nlink(dir, inode); in f2fs_delete_inline_entry()
729 bool f2fs_empty_inline_dir(struct inode *dir) in f2fs_empty_inline_dir() argument
731 struct f2fs_sb_info *sbi = F2FS_I_SB(dir); in f2fs_empty_inline_dir()
737 ipage = f2fs_get_node_page(sbi, dir->i_ino); in f2fs_empty_inline_dir()
741 inline_dentry = inline_data_addr(dir, ipage); in f2fs_empty_inline_dir()
742 make_dentry_ptr_inline(dir, &d, inline_dentry); in f2fs_empty_inline_dir()