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 inode *dir, struct dentry *dentry, umode_t mode, 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()
792 static int vfat_rmdir(struct inode *dir, struct dentry *dentry) in vfat_rmdir() argument
795 struct super_block *sb = dir->i_sb; in vfat_rmdir()
804 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_rmdir()
808 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_rmdir()
811 drop_nlink(dir); in vfat_rmdir()
816 vfat_d_version_set(dentry, inode_query_iversion(dir)); in vfat_rmdir()
823 static int vfat_unlink(struct inode *dir, struct dentry *dentry) in vfat_unlink() argument
826 struct super_block *sb = dir->i_sb; in vfat_unlink()
832 err = vfat_find(dir, &dentry->d_name, &sinfo); in vfat_unlink()
836 err = fat_remove_entries(dir, &sinfo); /* and releases bh */ in vfat_unlink()
842 vfat_d_version_set(dentry, inode_query_iversion(dir)); in vfat_unlink()
849 static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) in vfat_mkdir() argument
851 struct super_block *sb = dir->i_sb; in vfat_mkdir()
859 ts = current_time(dir); in vfat_mkdir()
860 cluster = fat_alloc_new_dir(dir, &ts); in vfat_mkdir()
865 err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); in vfat_mkdir()
868 inode_inc_iversion(dir); in vfat_mkdir()
869 inc_nlink(dir); in vfat_mkdir()
889 fat_free_clusters(dir, cluster); in vfat_mkdir()