• Home
  • Raw
  • Download

Lines Matching refs:dentry

22 static struct dentry *autofs_root_lookup(struct inode *,struct dentry *, struct nameidata *);
23 static int autofs_root_symlink(struct inode *,struct dentry *,const char *);
24 static int autofs_root_unlink(struct inode *,struct dentry *);
25 static int autofs_root_rmdir(struct inode *,struct dentry *);
26 static int autofs_root_mkdir(struct inode *,struct dentry *,int);
48 struct inode * inode = filp->f_path.dentry->d_inode; in autofs_root_readdir()
71 if (!ent->dentry || d_mountpoint(ent->dentry)) { in autofs_root_readdir()
85 static int try_to_fill_dentry(struct dentry *dentry, struct super_block *sb, struct autofs_sb_info … in try_to_fill_dentry() argument
91 if (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name))) { in try_to_fill_dentry()
93 if (status && dentry->d_inode) { in try_to_fill_dentry()
95 …arning: lookup failure on positive dentry, status = %d, name = %s\n", status, dentry->d_name.name); in try_to_fill_dentry()
101 dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT; in try_to_fill_dentry()
102 dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; in try_to_fill_dentry()
108 status = autofs_wait(sbi, &dentry->d_name); in try_to_fill_dentry()
109 } while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name))); in try_to_fill_dentry()
114 dentry->d_time = (unsigned long) ent; in try_to_fill_dentry()
116 if (!dentry->d_inode) { in try_to_fill_dentry()
122 dentry->d_inode = inode; in try_to_fill_dentry()
127 if (S_ISDIR(dentry->d_inode->i_mode) && !d_mountpoint(dentry)) { in try_to_fill_dentry()
128 return !autofs_wait(sbi, &dentry->d_name); in try_to_fill_dentry()
137 dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; in try_to_fill_dentry()
148 static int autofs_revalidate(struct dentry * dentry, struct nameidata *nd) in autofs_revalidate() argument
156 dir = dentry->d_parent->d_inode; in autofs_revalidate()
160 if (dentry->d_flags & DCACHE_AUTOFS_PENDING) { in autofs_revalidate()
164 res = try_to_fill_dentry(dentry, dir->i_sb, sbi); in autofs_revalidate()
170 if (!dentry->d_inode) { in autofs_revalidate()
172 return (dentry->d_time - jiffies <= AUTOFS_NEGATIVE_TIMEOUT); in autofs_revalidate()
176 if (S_ISDIR(dentry->d_inode->i_mode) && !d_mountpoint(dentry)) { in autofs_revalidate()
180 res = try_to_fill_dentry(dentry, dir->i_sb, sbi); in autofs_revalidate()
187 ent = (struct autofs_dir_ent *) dentry->d_time; in autofs_revalidate()
199 static struct dentry *autofs_root_lookup(struct inode *dir, struct dentry *dentry, struct nameidata… in autofs_root_lookup() argument
206 autofs_say(dentry->d_name.name,dentry->d_name.len); in autofs_root_lookup()
208 if (dentry->d_name.len > NAME_MAX) { in autofs_root_lookup()
231 dentry->d_op = &autofs_dentry_operations; in autofs_root_lookup()
232 dentry->d_flags |= DCACHE_AUTOFS_PENDING; in autofs_root_lookup()
233 d_add(dentry, NULL); in autofs_root_lookup()
236 autofs_revalidate(dentry, nd); in autofs_root_lookup()
243 if (dentry->d_flags & DCACHE_AUTOFS_PENDING) { in autofs_root_lookup()
263 if (dentry->d_inode && d_unhashed(dentry)) in autofs_root_lookup()
269 static int autofs_root_symlink(struct inode *dir, struct dentry *dentry, const char *symname) in autofs_root_symlink() argument
280 autofs_say(dentry->d_name.name,dentry->d_name.len); in autofs_root_symlink()
288 if (autofs_hash_lookup(dh, &dentry->d_name)) { in autofs_root_symlink()
317 ent->name = kmalloc(dentry->d_name.len+1, GFP_KERNEL); in autofs_root_symlink()
330 ent->hash = dentry->d_name.hash; in autofs_root_symlink()
331 memcpy(ent->name, dentry->d_name.name, 1+(ent->len = dentry->d_name.len)); in autofs_root_symlink()
332 ent->dentry = NULL; /* We don't keep the dentry for symlinks */ in autofs_root_symlink()
340 d_instantiate(dentry, inode); in autofs_root_symlink()
356 static int autofs_root_unlink(struct inode *dir, struct dentry *dentry) in autofs_root_unlink() argument
370 ent = autofs_hash_lookup(dh, &dentry->d_name); in autofs_root_unlink()
386 dentry->d_time = (unsigned long)(struct autofs_dirhash *)NULL; in autofs_root_unlink()
390 d_drop(dentry); in autofs_root_unlink()
396 static int autofs_root_rmdir(struct inode *dir, struct dentry *dentry) in autofs_root_rmdir() argument
408 ent = autofs_hash_lookup(dh, &dentry->d_name); in autofs_root_rmdir()
419 if (ent->dentry != dentry) { in autofs_root_rmdir()
420 printk("autofs_rmdir: odentry != dentry for entry %s\n", dentry->d_name.name); in autofs_root_rmdir()
423 dentry->d_time = (unsigned long)(struct autofs_dir_ent *)NULL; in autofs_root_rmdir()
426 d_drop(dentry); in autofs_root_rmdir()
432 static int autofs_root_mkdir(struct inode *dir, struct dentry *dentry, int mode) in autofs_root_mkdir() argument
446 ent = autofs_hash_lookup(dh, &dentry->d_name); in autofs_root_mkdir()
465 ent->name = kmalloc(dentry->d_name.len+1, GFP_KERNEL); in autofs_root_mkdir()
472 ent->hash = dentry->d_name.hash; in autofs_root_mkdir()
473 memcpy(ent->name, dentry->d_name.name, 1+(ent->len = dentry->d_name.len)); in autofs_root_mkdir()
475 ent->dentry = dentry; in autofs_root_mkdir()
486 d_instantiate(dentry, inode); in autofs_root_mkdir()