Lines Matching refs:dentry

15 			      struct dentry *, const char *);
16 static int autofs_dir_unlink(struct inode *, struct dentry *);
17 static int autofs_dir_rmdir(struct inode *, struct dentry *);
19 struct dentry *, umode_t);
26 static struct dentry *autofs_lookup(struct inode *,
27 struct dentry *, unsigned int);
30 static void autofs_dentry_release(struct dentry *);
67 static void autofs_del_active(struct dentry *dentry) in autofs_del_active() argument
69 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_del_active()
72 ino = autofs_dentry_ino(dentry); in autofs_del_active()
80 struct dentry *dentry = file->f_path.dentry; in autofs_dir_open() local
81 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_dir_open()
82 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_dir_open()
84 pr_debug("file=%p dentry=%p %pd\n", file, dentry, dentry); in autofs_dir_open()
109 static void autofs_dentry_release(struct dentry *de) in autofs_dentry_release()
131 static struct dentry *autofs_lookup_active(struct dentry *dentry) in autofs_lookup_active() argument
133 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_lookup_active()
134 struct dentry *parent = dentry->d_parent; in autofs_lookup_active()
135 const struct qstr *name = &dentry->d_name; in autofs_lookup_active()
147 struct dentry *active; in autofs_lookup_active()
151 active = ino->dentry; in autofs_lookup_active()
185 static struct dentry *autofs_lookup_expiring(struct dentry *dentry, in autofs_lookup_expiring() argument
188 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_lookup_expiring()
189 struct dentry *parent = dentry->d_parent; in autofs_lookup_expiring()
190 const struct qstr *name = &dentry->d_name; in autofs_lookup_expiring()
202 struct dentry *expiring; in autofs_lookup_expiring()
211 expiring = ino->dentry; in autofs_lookup_expiring()
247 struct autofs_sb_info *sbi = autofs_sbi(path->dentry->d_sb); in autofs_mount_wait()
248 struct autofs_info *ino = autofs_dentry_ino(path->dentry); in autofs_mount_wait()
254 pr_debug("waiting for mount name=%pd\n", path->dentry); in autofs_mount_wait()
267 struct dentry *dentry = path->dentry; in do_expire_wait() local
268 struct dentry *expiring; in do_expire_wait()
270 expiring = autofs_lookup_expiring(dentry, rcu_walk); in do_expire_wait()
276 const struct path this = { .mnt = path->mnt, .dentry = expiring }; in do_expire_wait()
289 static struct dentry *autofs_mountpoint_changed(struct path *path) in autofs_mountpoint_changed()
291 struct dentry *dentry = path->dentry; in autofs_mountpoint_changed() local
292 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_mountpoint_changed()
315 if (autofs_type_indirect(sbi->type) && d_unhashed(dentry)) { in autofs_mountpoint_changed()
316 struct dentry *parent = dentry->d_parent; in autofs_mountpoint_changed()
318 struct dentry *new; in autofs_mountpoint_changed()
320 new = d_lookup(parent, &dentry->d_name); in autofs_mountpoint_changed()
325 dput(path->dentry); in autofs_mountpoint_changed()
326 path->dentry = new; in autofs_mountpoint_changed()
328 return path->dentry; in autofs_mountpoint_changed()
333 struct dentry *dentry = path->dentry; in autofs_d_automount() local
334 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_d_automount()
335 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_d_automount()
338 pr_debug("dentry=%p %pd\n", dentry, dentry); in autofs_d_automount()
371 if (d_really_is_positive(dentry) && d_is_symlink(dentry)) { in autofs_d_automount()
412 dentry = autofs_mountpoint_changed(path); in autofs_d_automount()
413 if (!dentry) in autofs_d_automount()
421 struct dentry *dentry = path->dentry; in autofs_d_manage() local
422 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_d_manage()
423 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_d_manage()
426 pr_debug("dentry=%p %pd\n", dentry, dentry); in autofs_d_manage()
460 inode = d_inode_rcu(dentry); in autofs_d_manage()
484 (d_really_is_positive(dentry) && d_is_symlink(dentry))) in autofs_d_manage()
493 static struct dentry *autofs_lookup(struct inode *dir, in autofs_lookup()
494 struct dentry *dentry, unsigned int flags) in autofs_lookup() argument
498 struct dentry *active; in autofs_lookup()
500 pr_debug("name = %pd\n", dentry); in autofs_lookup()
503 if (dentry->d_name.len > NAME_MAX) in autofs_lookup()
513 active = autofs_lookup_active(dentry); in autofs_lookup()
523 if (!autofs_oz_mode(sbi) && !IS_ROOT(dentry->d_parent)) in autofs_lookup()
531 spin_lock(&dentry->d_lock); in autofs_lookup()
533 if (IS_ROOT(dentry->d_parent) && in autofs_lookup()
535 __managed_dentry_set_managed(dentry); in autofs_lookup()
536 dentry->d_fsdata = ino; in autofs_lookup()
537 ino->dentry = dentry; in autofs_lookup()
541 spin_unlock(&dentry->d_lock); in autofs_lookup()
567 struct inode *dir, struct dentry *dentry, in autofs_dir_symlink() argument
570 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_dir_symlink()
576 pr_debug("%s <- %pd\n", symname, dentry); in autofs_dir_symlink()
582 autofs_del_active(dentry); in autofs_dir_symlink()
597 d_add(dentry, inode); in autofs_dir_symlink()
599 dget(dentry); in autofs_dir_symlink()
600 p_ino = autofs_dentry_ino(dentry->d_parent); in autofs_dir_symlink()
623 static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry) in autofs_dir_unlink() argument
626 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_dir_unlink()
629 p_ino = autofs_dentry_ino(dentry->d_parent); in autofs_dir_unlink()
631 dput(ino->dentry); in autofs_dir_unlink()
633 d_inode(dentry)->i_size = 0; in autofs_dir_unlink()
634 clear_nlink(d_inode(dentry)); in autofs_dir_unlink()
639 __autofs_add_expiring(dentry); in autofs_dir_unlink()
640 d_drop(dentry); in autofs_dir_unlink()
657 static void autofs_set_leaf_automount_flags(struct dentry *dentry) in autofs_set_leaf_automount_flags() argument
659 struct dentry *parent; in autofs_set_leaf_automount_flags()
662 if (IS_ROOT(dentry->d_parent)) in autofs_set_leaf_automount_flags()
665 managed_dentry_set_managed(dentry); in autofs_set_leaf_automount_flags()
667 parent = dentry->d_parent; in autofs_set_leaf_automount_flags()
674 static void autofs_clear_leaf_automount_flags(struct dentry *dentry) in autofs_clear_leaf_automount_flags() argument
676 struct dentry *parent; in autofs_clear_leaf_automount_flags()
679 if (IS_ROOT(dentry->d_parent)) in autofs_clear_leaf_automount_flags()
682 managed_dentry_clear_managed(dentry); in autofs_clear_leaf_automount_flags()
684 parent = dentry->d_parent; in autofs_clear_leaf_automount_flags()
692 static int autofs_dir_rmdir(struct inode *dir, struct dentry *dentry) in autofs_dir_rmdir() argument
695 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_dir_rmdir()
698 pr_debug("dentry %p, removing %pd\n", dentry, dentry); in autofs_dir_rmdir()
704 __autofs_add_expiring(dentry); in autofs_dir_rmdir()
705 d_drop(dentry); in autofs_dir_rmdir()
709 autofs_clear_leaf_automount_flags(dentry); in autofs_dir_rmdir()
711 p_ino = autofs_dentry_ino(dentry->d_parent); in autofs_dir_rmdir()
713 dput(ino->dentry); in autofs_dir_rmdir()
714 d_inode(dentry)->i_size = 0; in autofs_dir_rmdir()
715 clear_nlink(d_inode(dentry)); in autofs_dir_rmdir()
724 struct inode *dir, struct dentry *dentry, in autofs_dir_mkdir() argument
728 struct autofs_info *ino = autofs_dentry_ino(dentry); in autofs_dir_mkdir()
732 pr_debug("dentry %p, creating %pd\n", dentry, dentry); in autofs_dir_mkdir()
738 autofs_del_active(dentry); in autofs_dir_mkdir()
743 d_add(dentry, inode); in autofs_dir_mkdir()
746 autofs_set_leaf_automount_flags(dentry); in autofs_dir_mkdir()
748 dget(dentry); in autofs_dir_mkdir()
749 p_ino = autofs_dentry_ino(dentry->d_parent); in autofs_dir_mkdir()
843 int is_autofs_dentry(struct dentry *dentry) in is_autofs_dentry() argument
845 return dentry && d_really_is_positive(dentry) && in is_autofs_dentry()
846 dentry->d_op == &autofs_dentry_operations && in is_autofs_dentry()
847 dentry->d_fsdata != NULL; in is_autofs_dentry()