Lines Matching refs:dir
222 static int vfat_find_form(struct inode *dir, unsigned char *name) in vfat_find_form() argument
225 int err = fat_scan(dir, name, &sinfo); in vfat_find_form()
313 static int vfat_create_shortname(struct inode *dir, struct nls_table *nls, in vfat_create_shortname() argument
317 struct fat_mount_options *opts = &MSDOS_SB(dir->i_sb)->options; in vfat_create_shortname()
434 if (vfat_find_form(dir, name_res) == 0) in vfat_create_shortname()
455 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
473 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
488 if (vfat_find_form(dir, name_res) < 0) in vfat_create_shortname()
578 static int vfat_build_slots(struct inode *dir, const unsigned char *name, in vfat_build_slots() argument
583 struct msdos_sb_info *sbi = MSDOS_SB(dir->i_sb); in vfat_build_slots()
610 err = vfat_create_shortname(dir, sbi->nls_disk, uname, ulen, in vfat_build_slots()
655 static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, in vfat_add_entry() argument
671 err = vfat_build_slots(dir, qname->name, len, is_dir, cluster, ts, in vfat_add_entry()
676 err = fat_add_entries(dir, slots, nr_slots, sinfo); in vfat_add_entry()
681 dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; in vfat_add_entry()
682 if (IS_DIRSYNC(dir)) in vfat_add_entry()
683 (void)fat_sync_inode(dir); in vfat_add_entry()
685 mark_inode_dirty(dir); in vfat_add_entry()
691 static int vfat_find(struct inode *dir, struct qstr *qname, in vfat_find() argument
697 return fat_search_long(dir, qname->name, len, sinfo); in vfat_find()
709 static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, in vfat_lookup() argument
712 struct super_block *sb = dir->i_sb; in vfat_lookup()
720 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_lookup()
762 dentry->d_time = dir->i_version; in vfat_lookup()
769 static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, in vfat_create() argument
772 struct super_block *sb = dir->i_sb; in vfat_create()
781 err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); in vfat_create()
784 dir->i_version++; in vfat_create()
802 static int vfat_rmdir(struct inode *dir, struct dentry *dentry) in vfat_rmdir() argument
805 struct super_block *sb = dir->i_sb; in vfat_rmdir()
814 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_rmdir()
818 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_rmdir()
821 drop_nlink(dir); in vfat_rmdir()
826 dentry->d_time = dir->i_version; in vfat_rmdir()
833 static int vfat_unlink(struct inode *dir, struct dentry *dentry) in vfat_unlink() argument
836 struct super_block *sb = dir->i_sb; in vfat_unlink()
842 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_unlink()
846 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_unlink()
852 dentry->d_time = dir->i_version; in vfat_unlink()
859 static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in vfat_mkdir() argument
861 struct super_block *sb = dir->i_sb; in vfat_mkdir()
870 cluster = fat_alloc_new_dir(dir, &ts); in vfat_mkdir()
875 err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); in vfat_mkdir()
878 dir->i_version++; in vfat_mkdir()
879 inc_nlink(dir); in vfat_mkdir()
899 fat_free_clusters(dir, cluster); in vfat_mkdir()