Lines Matching refs:fname
76 struct f2fs_filename *fname) in f2fs_init_casefolded_name() argument
82 !is_dot_dotdot(fname->usr_fname->name, fname->usr_fname->len)) { in f2fs_init_casefolded_name()
83 fname->cf_name.name = f2fs_kmalloc(sbi, F2FS_NAME_LEN, in f2fs_init_casefolded_name()
85 if (!fname->cf_name.name) in f2fs_init_casefolded_name()
87 fname->cf_name.len = utf8_casefold(sbi->sb->s_encoding, in f2fs_init_casefolded_name()
88 fname->usr_fname, in f2fs_init_casefolded_name()
89 fname->cf_name.name, in f2fs_init_casefolded_name()
91 if ((int)fname->cf_name.len <= 0) { in f2fs_init_casefolded_name()
92 kfree(fname->cf_name.name); in f2fs_init_casefolded_name()
93 fname->cf_name.name = NULL; in f2fs_init_casefolded_name()
105 struct f2fs_filename *fname) in __f2fs_setup_filename() argument
109 memset(fname, 0, sizeof(*fname)); in __f2fs_setup_filename()
111 fname->usr_fname = crypt_name->usr_fname; in __f2fs_setup_filename()
112 fname->disk_name = crypt_name->disk_name; in __f2fs_setup_filename()
114 fname->crypto_buf = crypt_name->crypto_buf; in __f2fs_setup_filename()
118 fname->hash = cpu_to_le32(crypt_name->hash); in __f2fs_setup_filename()
120 err = f2fs_init_casefolded_name(dir, fname); in __f2fs_setup_filename()
122 f2fs_free_filename(fname); in __f2fs_setup_filename()
125 f2fs_hash_filename(dir, fname); in __f2fs_setup_filename()
137 int lookup, struct f2fs_filename *fname) in f2fs_setup_filename() argument
146 return __f2fs_setup_filename(dir, &crypt_name, fname); in f2fs_setup_filename()
156 struct f2fs_filename *fname) in f2fs_prepare_lookup() argument
165 return __f2fs_setup_filename(dir, &crypt_name, fname); in f2fs_prepare_lookup()
168 void f2fs_free_filename(struct f2fs_filename *fname) in f2fs_free_filename() argument
171 kfree(fname->crypto_buf.name); in f2fs_free_filename()
172 fname->crypto_buf.name = NULL; in f2fs_free_filename()
175 kfree(fname->cf_name.name); in f2fs_free_filename()
176 fname->cf_name.name = NULL; in f2fs_free_filename()
194 const struct f2fs_filename *fname, in find_in_block() argument
205 de = f2fs_find_target_dentry(&d, fname, max_slots); in find_in_block()
262 const struct f2fs_filename *fname, in f2fs_match_name() argument
268 if (fname->cf_name.name) { in f2fs_match_name()
269 struct qstr cf = FSTR_TO_QSTR(&fname->cf_name); in f2fs_match_name()
274 f.usr_fname = fname->usr_fname; in f2fs_match_name()
275 f.disk_name = fname->disk_name; in f2fs_match_name()
277 f.crypto_buf = fname->crypto_buf; in f2fs_match_name()
283 const struct f2fs_filename *fname, int *max_slots) in f2fs_find_target_dentry() argument
305 if (de->hash_code == fname->hash && in f2fs_find_target_dentry()
306 f2fs_match_name(d->inode, fname, d->filename[bit_pos], in f2fs_find_target_dentry()
326 const struct f2fs_filename *fname, in find_in_level() argument
329 int s = GET_DENTRY_SLOTS(fname->disk_name.len); in find_in_level()
341 le32_to_cpu(fname->hash) % nbucket); in find_in_level()
357 de = find_in_block(dir, dentry_page, fname, &max_slots, in find_in_level()
367 if (!de && room && F2FS_I(dir)->chash != fname->hash) { in find_in_level()
368 F2FS_I(dir)->chash = fname->hash; in find_in_level()
376 const struct f2fs_filename *fname, in __f2fs_find_entry() argument
387 de = f2fs_find_in_inline_dir(dir, fname, res_page); in __f2fs_find_entry()
403 de = find_in_level(dir, level, fname, res_page); in __f2fs_find_entry()
424 struct f2fs_filename fname; in f2fs_find_entry() local
427 err = f2fs_setup_filename(dir, child, 1, &fname); in f2fs_find_entry()
436 de = __f2fs_find_entry(dir, &fname, res_page); in f2fs_find_entry()
438 f2fs_free_filename(&fname); in f2fs_find_entry()
480 const struct f2fs_filename *fname, in init_dent_inode() argument
485 if (!fname) /* tmpfile case? */ in init_dent_inode()
492 ri->i_namelen = cpu_to_le32(fname->disk_name.len); in init_dent_inode()
493 memcpy(ri->i_name, fname->disk_name.name, fname->disk_name.len); in init_dent_inode()
504 if (fname->disk_name.len + sizeof(f2fs_hash_t) <= in init_dent_inode()
506 put_unaligned(fname->hash, (f2fs_hash_t *) in init_dent_inode()
507 &ri->i_name[fname->disk_name.len]); in init_dent_inode()
553 const struct f2fs_filename *fname, struct page *dpage) in f2fs_init_inode_metadata() argument
579 fname ? fname->usr_fname : NULL, page); in f2fs_init_inode_metadata()
594 init_dent_inode(dir, inode, fname, page); in f2fs_init_inode_metadata()
659 const struct f2fs_filename *fname) in f2fs_has_enough_room() argument
663 int slots = GET_DENTRY_SLOTS(fname->disk_name.len); in f2fs_has_enough_room()
694 int f2fs_add_regular_entry(struct inode *dir, const struct f2fs_filename *fname, in f2fs_add_regular_entry() argument
709 slots = GET_DENTRY_SLOTS(fname->disk_name.len); in f2fs_add_regular_entry()
712 if (F2FS_I(dir)->chash == fname->hash) { in f2fs_add_regular_entry()
734 (le32_to_cpu(fname->hash) % nbucket)); in f2fs_add_regular_entry()
758 page = f2fs_init_inode_metadata(inode, dir, fname, NULL); in f2fs_add_regular_entry()
766 f2fs_update_dentry(ino, mode, &d, &fname->disk_name, fname->hash, in f2fs_add_regular_entry()
791 int f2fs_add_dentry(struct inode *dir, const struct f2fs_filename *fname, in f2fs_add_dentry() argument
797 err = f2fs_add_inline_entry(dir, fname, inode, ino, mode); in f2fs_add_dentry()
799 err = f2fs_add_regular_entry(dir, fname, inode, ino, mode); in f2fs_add_dentry()
812 struct f2fs_filename fname; in f2fs_do_add_link() local
817 err = f2fs_setup_filename(dir, name, 0, &fname); in f2fs_do_add_link()
829 de = __f2fs_find_entry(dir, &fname, &page); in f2fs_do_add_link()
838 err = f2fs_add_dentry(dir, &fname, inode, ino, mode); in f2fs_do_add_link()
840 f2fs_free_filename(&fname); in f2fs_do_add_link()