Lines Matching refs:dir

236 static int vfat_find_form(struct inode *dir, unsigned char *name)  in vfat_find_form()  argument
239 int err = fat_scan(dir, name, &sinfo); in vfat_find_form()
327 static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, in vfat_create_shortname() argument
331 struct fat_mount_options *opts = &MSDOS_SB(dir->i_sb)->options; in vfat_create_shortname()
448 if (vfat_find_form(dir, name_res) == 0) in vfat_create_shortname()
469 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
487 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
502 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
579 static int vfat_build_slots(struct inode *dir, const unsigned char *name, in vfat_build_slots() argument
584 struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); in vfat_build_slots()
611 err = vfat_create_shortname(dir, sbi->nls_disk, uname, ulen, in vfat_build_slots()
656 static int vfat_add_entry(struct inode *dir, const struct qstr *qname, in vfat_add_entry() argument
672 err = vfat_build_slots(dir, qname->name, len, is_dir, cluster, ts, in vfat_add_entry()
677 err = fat_add_entries(dir, slots, nr_slots, sinfo); in vfat_add_entry()
682 fat_truncate_time(dir, ts, S_CTIME|S_MTIME); in vfat_add_entry()
683 if (IS_DIRSYNC(dir)) in vfat_add_entry()
684 (void)fat_sync_inode(dir); in vfat_add_entry()
686 mark_inode_dirty(dir); in vfat_add_entry()
692 static int vfat_find(struct inode *dir, const struct qstr *qname, in vfat_find() argument
698 return fat_search_long(dir, qname->name, len, sinfo); in vfat_find()
701 static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, in vfat_lookup() argument
704 struct super_block *sb = dir->i_sb; in vfat_lookup()
712 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_lookup()
752 vfat_d_version_set(dentry, inode_query_iversion(dir)); in vfat_lookup()
759 static int vfat_create(struct mnt_idmap *idmap, struct inode *dir, in vfat_create() argument
762 struct super_block *sb = dir->i_sb; in vfat_create()
770 ts = current_time(dir); in vfat_create()
771 err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); in vfat_create()
774 inode_inc_iversion(dir); in vfat_create()
790 static int vfat_rmdir(struct inode *dir, struct dentry *dentry) in vfat_rmdir() argument
793 struct super_block *sb = dir->i_sb; in vfat_rmdir()
802 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_rmdir()
806 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_rmdir()
809 drop_nlink(dir); in vfat_rmdir()
814 vfat_d_version_set(dentry, inode_query_iversion(dir)); in vfat_rmdir()
821 static int vfat_unlink(struct inode *dir, struct dentry *dentry) in vfat_unlink() argument
824 struct super_block *sb = dir->i_sb; in vfat_unlink()
830 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_unlink()
834 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_unlink()
840 vfat_d_version_set(dentry, inode_query_iversion(dir)); in vfat_unlink()
847 static int vfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, in vfat_mkdir() argument
850 struct super_block *sb = dir->i_sb; in vfat_mkdir()
858 ts = current_time(dir); in vfat_mkdir()
859 cluster = fat_alloc_new_dir(dir, &ts); in vfat_mkdir()
864 err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); in vfat_mkdir()
867 inode_inc_iversion(dir); in vfat_mkdir()
868 inc_nlink(dir); in vfat_mkdir()
886 fat_free_clusters(dir, cluster); in vfat_mkdir()
902 static int vfat_sync_ipos(struct inode *dir, struct inode *inode) in vfat_sync_ipos() argument
904 if (IS_DIRSYNC(dir)) in vfat_sync_ipos()
910 static int vfat_update_dotdot_de(struct inode *dir, struct inode *inode, in vfat_update_dotdot_de() argument
914 fat_set_start(dotdot_de, MSDOS_I(dir)->i_logstart); in vfat_update_dotdot_de()
916 if (IS_DIRSYNC(dir)) in vfat_update_dotdot_de()
921 static void vfat_update_dir_metadata(struct inode *dir, struct timespec64 *ts) in vfat_update_dir_metadata() argument
923 inode_inc_iversion(dir); in vfat_update_dir_metadata()
924 fat_truncate_time(dir, ts, S_CTIME | S_MTIME); in vfat_update_dir_metadata()
925 if (IS_DIRSYNC(dir)) in vfat_update_dir_metadata()
926 (void)fat_sync_inode(dir); in vfat_update_dir_metadata()
928 mark_inode_dirty(dir); in vfat_update_dir_metadata()