Lines Matching refs:dentry

81 static inline struct hlist_head *m_hash(struct vfsmount *mnt, struct dentry *dentry)  in m_hash()  argument
84 tmp += ((unsigned long)dentry / L1_CACHE_BYTES); in m_hash()
89 static inline struct hlist_head *mp_hash(struct dentry *dentry) in mp_hash() argument
91 unsigned long tmp = ((unsigned long)dentry / L1_CACHE_BYTES); in mp_hash()
629 struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt() argument
631 struct hlist_head *head = m_hash(mnt, dentry); in __lookup_mnt()
635 if (&p->mnt_parent->mnt == mnt && p->mnt_mountpoint == dentry) in __lookup_mnt()
644 struct mount *__lookup_mnt_last(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt_last() argument
647 p = __lookup_mnt(mnt, dentry); in __lookup_mnt_last()
653 if (&p->mnt_parent->mnt != mnt || p->mnt_mountpoint != dentry) in __lookup_mnt_last()
687 child_mnt = __lookup_mnt(path->mnt, path->dentry); in lookup_mnt()
709 bool __is_local_mountpoint(struct dentry *dentry) in __is_local_mountpoint() argument
715 if (!d_mountpoint(dentry)) in __is_local_mountpoint()
720 is_covered = (mnt->mnt_mountpoint == dentry); in __is_local_mountpoint()
729 static struct mountpoint *lookup_mountpoint(struct dentry *dentry) in lookup_mountpoint() argument
731 struct hlist_head *chain = mp_hash(dentry); in lookup_mountpoint()
735 if (mp->m_dentry == dentry) { in lookup_mountpoint()
737 if (d_unlinked(dentry)) in lookup_mountpoint()
746 static struct mountpoint *new_mountpoint(struct dentry *dentry) in new_mountpoint() argument
748 struct hlist_head *chain = mp_hash(dentry); in new_mountpoint()
756 ret = d_set_mounted(dentry); in new_mountpoint()
762 mp->m_dentry = dentry; in new_mountpoint()
772 struct dentry *dentry = mp->m_dentry; in put_mountpoint() local
774 spin_lock(&dentry->d_lock); in put_mountpoint()
775 dentry->d_flags &= ~DCACHE_MOUNTED; in put_mountpoint()
776 spin_unlock(&dentry->d_lock); in put_mountpoint()
828 old_path->dentry = mnt->mnt_mountpoint; in detach_mnt()
936 struct dentry *root; in vfs_kern_mount()
966 static struct mount *clone_mnt(struct mount *old, struct dentry *root, in clone_mnt()
1159 p = clone_mnt(real_mount(path->mnt), path->dentry, CL_PRIVATE); in mnt_clone_internal()
1177 int generic_show_options(struct seq_file *m, struct dentry *root) in generic_show_options()
1554 void __detach_mounts(struct dentry *dentry) in __detach_mounts() argument
1560 mp = lookup_mountpoint(dentry); in __detach_mounts()
1616 if (path.dentry != path.mnt->mnt_root) in SYSCALL_DEFINE2()
1629 dput(path.dentry); in SYSCALL_DEFINE2()
1647 static bool is_mnt_ns_file(struct dentry *dentry) in is_mnt_ns_file() argument
1650 return dentry->d_op == &ns_dentry_operations && in is_mnt_ns_file()
1651 dentry->d_fsdata == &mntns_operations; in is_mnt_ns_file()
1659 static bool mnt_ns_loop(struct dentry *dentry) in mnt_ns_loop() argument
1665 if (!is_mnt_ns_file(dentry)) in mnt_ns_loop()
1668 mnt_ns = to_mnt_ns(get_proc_ns(dentry->d_inode)); in mnt_ns_loop()
1672 struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, in copy_tree() argument
1680 if (!(flag & CL_COPY_MNT_NS_FILE) && is_mnt_ns_file(dentry)) in copy_tree()
1683 res = q = clone_mnt(mnt, dentry, flag); in copy_tree()
1692 if (!is_subdir(r->mnt_mountpoint, dentry)) in copy_tree()
1748 tree = copy_tree(real_mount(path->mnt), path->dentry, in collect_mounts()
1783 new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE); in clone_private_mount()
1954 struct dentry *dentry = path->dentry; in lock_mount() local
1956 mutex_lock(&dentry->d_inode->i_mutex); in lock_mount()
1957 if (unlikely(cant_mount(dentry))) { in lock_mount()
1958 mutex_unlock(&dentry->d_inode->i_mutex); in lock_mount()
1964 struct mountpoint *mp = lookup_mountpoint(dentry); in lock_mount()
1966 mp = new_mountpoint(dentry); in lock_mount()
1969 mutex_unlock(&dentry->d_inode->i_mutex); in lock_mount()
1975 mutex_unlock(&path->dentry->d_inode->i_mutex); in lock_mount()
1978 dentry = path->dentry = dget(mnt->mnt_root); in lock_mount()
1984 struct dentry *dentry = where->m_dentry; in unlock_mount() local
1987 mutex_unlock(&dentry->d_inode->i_mutex); in unlock_mount()
2030 if (path->dentry != path->mnt->mnt_root) in do_change_type()
2054 static bool has_locked_children(struct mount *mnt, struct dentry *dentry) in has_locked_children() argument
2058 if (!is_subdir(child->mnt_mountpoint, dentry)) in has_locked_children()
2084 if (mnt_ns_loop(old_path.dentry)) in do_loopback()
2102 if (!check_mnt(old) && old_path.dentry->d_op != &ns_dentry_operations) in do_loopback()
2105 if (!recurse && has_locked_children(old, old_path.dentry)) in do_loopback()
2109 mnt = copy_tree(old, old_path.dentry, CL_COPY_MNT_NS_FILE); in do_loopback()
2111 mnt = clone_mnt(old, old_path.dentry, 0); in do_loopback()
2165 if (path->dentry != path->mnt->mnt_root) in do_remount()
2262 if (old_path.dentry != old_path.mnt->mnt_root) in do_move_mount()
2268 if (d_is_dir(path->dentry) != in do_move_mount()
2269 d_is_dir(old_path.dentry)) in do_move_mount()
2355 path->mnt->mnt_root == path->dentry) in do_add_mount()
2434 m->mnt_root == path->dentry) { in finish_automount()
2863 struct dentry *mount_subtree(struct vfsmount *mnt, const char *name) in mount_subtree()
2889 return path.dentry; in mount_subtree()
2932 bool is_path_reachable(struct mount *mnt, struct dentry *dentry, in is_path_reachable() argument
2936 dentry = mnt->mnt_mountpoint; in is_path_reachable()
2939 return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry); in is_path_reachable()
2946 res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2); in path_is_under()
3019 if (d_unlinked(new.dentry)) in SYSCALL_DEFINE2()
3025 if (root.mnt->mnt_root != root.dentry) in SYSCALL_DEFINE2()
3030 if (new.mnt->mnt_root != new.dentry) in SYSCALL_DEFINE2()
3035 if (!is_path_reachable(old_mnt, old.dentry, &new)) in SYSCALL_DEFINE2()
3038 if (!is_path_reachable(new_mnt, new.dentry, &root)) in SYSCALL_DEFINE2()
3098 root.dentry = mnt->mnt_root; in init_mount_tree()
3193 ns_root.dentry = ns_root.mnt->mnt_root; in current_chrooted()
3195 while (d_mountpoint(ns_root.dentry) && follow_down_one(&ns_root)) in current_chrooted()
3327 root.dentry = mnt_ns->root->mnt.mnt_root; in mntns_install()
3329 while(d_mountpoint(root.dentry) && follow_down_one(&root)) in mntns_install()