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()
618 struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt() argument
620 struct hlist_head *head = m_hash(mnt, dentry); in __lookup_mnt()
624 if (&p->mnt_parent->mnt == mnt && p->mnt_mountpoint == dentry) in __lookup_mnt()
633 struct mount *__lookup_mnt_last(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt_last() argument
636 p = __lookup_mnt(mnt, dentry); in __lookup_mnt_last()
642 if (&p->mnt_parent->mnt != mnt || p->mnt_mountpoint != dentry) in __lookup_mnt_last()
676 child_mnt = __lookup_mnt(path->mnt, path->dentry); in lookup_mnt()
698 bool __is_local_mountpoint(struct dentry *dentry) in __is_local_mountpoint() argument
704 if (!d_mountpoint(dentry)) in __is_local_mountpoint()
709 is_covered = (mnt->mnt_mountpoint == dentry); in __is_local_mountpoint()
718 static struct mountpoint *lookup_mountpoint(struct dentry *dentry) in lookup_mountpoint() argument
720 struct hlist_head *chain = mp_hash(dentry); in lookup_mountpoint()
724 if (mp->m_dentry == dentry) { in lookup_mountpoint()
726 if (d_unlinked(dentry)) in lookup_mountpoint()
735 static struct mountpoint *new_mountpoint(struct dentry *dentry) in new_mountpoint() argument
737 struct hlist_head *chain = mp_hash(dentry); in new_mountpoint()
745 ret = d_set_mounted(dentry); in new_mountpoint()
751 mp->m_dentry = dentry; in new_mountpoint()
761 struct dentry *dentry = mp->m_dentry; in put_mountpoint() local
763 spin_lock(&dentry->d_lock); in put_mountpoint()
764 dentry->d_flags &= ~DCACHE_MOUNTED; in put_mountpoint()
765 spin_unlock(&dentry->d_lock); in put_mountpoint()
817 old_path->dentry = mnt->mnt_mountpoint; in detach_mnt()
925 struct dentry *root; in vfs_kern_mount()
955 static struct mount *clone_mnt(struct mount *old, struct dentry *root, in clone_mnt()
1148 p = clone_mnt(real_mount(path->mnt), path->dentry, CL_PRIVATE); in mnt_clone_internal()
1166 int generic_show_options(struct seq_file *m, struct dentry *root) in generic_show_options()
1543 void __detach_mounts(struct dentry *dentry) in __detach_mounts() argument
1549 mp = lookup_mountpoint(dentry); in __detach_mounts()
1605 if (path.dentry != path.mnt->mnt_root) in SYSCALL_DEFINE2()
1618 dput(path.dentry); in SYSCALL_DEFINE2()
1636 static bool is_mnt_ns_file(struct dentry *dentry) in is_mnt_ns_file() argument
1639 return dentry->d_op == &ns_dentry_operations && in is_mnt_ns_file()
1640 dentry->d_fsdata == &mntns_operations; in is_mnt_ns_file()
1648 static bool mnt_ns_loop(struct dentry *dentry) in mnt_ns_loop() argument
1654 if (!is_mnt_ns_file(dentry)) in mnt_ns_loop()
1657 mnt_ns = to_mnt_ns(get_proc_ns(dentry->d_inode)); in mnt_ns_loop()
1661 struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, in copy_tree() argument
1669 if (!(flag & CL_COPY_MNT_NS_FILE) && is_mnt_ns_file(dentry)) in copy_tree()
1672 res = q = clone_mnt(mnt, dentry, flag); in copy_tree()
1681 if (!is_subdir(r->mnt_mountpoint, dentry)) in copy_tree()
1737 tree = copy_tree(real_mount(path->mnt), path->dentry, in collect_mounts()
1772 new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE); in clone_private_mount()
1943 struct dentry *dentry = path->dentry; in lock_mount() local
1945 mutex_lock(&dentry->d_inode->i_mutex); in lock_mount()
1946 if (unlikely(cant_mount(dentry))) { in lock_mount()
1947 mutex_unlock(&dentry->d_inode->i_mutex); in lock_mount()
1953 struct mountpoint *mp = lookup_mountpoint(dentry); in lock_mount()
1955 mp = new_mountpoint(dentry); in lock_mount()
1958 mutex_unlock(&dentry->d_inode->i_mutex); in lock_mount()
1964 mutex_unlock(&path->dentry->d_inode->i_mutex); in lock_mount()
1967 dentry = path->dentry = dget(mnt->mnt_root); in lock_mount()
1973 struct dentry *dentry = where->m_dentry; in unlock_mount() local
1976 mutex_unlock(&dentry->d_inode->i_mutex); in unlock_mount()
2019 if (path->dentry != path->mnt->mnt_root) in do_change_type()
2043 static bool has_locked_children(struct mount *mnt, struct dentry *dentry) in has_locked_children() argument
2047 if (!is_subdir(child->mnt_mountpoint, dentry)) in has_locked_children()
2073 if (mnt_ns_loop(old_path.dentry)) in do_loopback()
2091 if (!check_mnt(old) && old_path.dentry->d_op != &ns_dentry_operations) in do_loopback()
2094 if (!recurse && has_locked_children(old, old_path.dentry)) in do_loopback()
2098 mnt = copy_tree(old, old_path.dentry, CL_COPY_MNT_NS_FILE); in do_loopback()
2100 mnt = clone_mnt(old, old_path.dentry, 0); in do_loopback()
2154 if (path->dentry != path->mnt->mnt_root) in do_remount()
2251 if (old_path.dentry != old_path.mnt->mnt_root) in do_move_mount()
2257 if (d_is_dir(path->dentry) != in do_move_mount()
2258 d_is_dir(old_path.dentry)) in do_move_mount()
2344 path->mnt->mnt_root == path->dentry) in do_add_mount()
2425 m->mnt_root == path->dentry) { in finish_automount()
2854 struct dentry *mount_subtree(struct vfsmount *mnt, const char *name) in mount_subtree()
2880 return path.dentry; in mount_subtree()
2923 bool is_path_reachable(struct mount *mnt, struct dentry *dentry, in is_path_reachable() argument
2927 dentry = mnt->mnt_mountpoint; in is_path_reachable()
2930 return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry); in is_path_reachable()
2937 res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2); in path_is_under()
3010 if (d_unlinked(new.dentry)) in SYSCALL_DEFINE2()
3016 if (root.mnt->mnt_root != root.dentry) in SYSCALL_DEFINE2()
3021 if (new.mnt->mnt_root != new.dentry) in SYSCALL_DEFINE2()
3026 if (!is_path_reachable(old_mnt, old.dentry, &new)) in SYSCALL_DEFINE2()
3029 if (!is_path_reachable(new_mnt, new.dentry, &root)) in SYSCALL_DEFINE2()
3089 root.dentry = mnt->mnt_root; in init_mount_tree()
3184 ns_root.dentry = ns_root.mnt->mnt_root; in current_chrooted()
3186 while (d_mountpoint(ns_root.dentry) && follow_down_one(&ns_root)) in current_chrooted()
3301 root.dentry = mnt_ns->root->mnt.mnt_root; in mntns_install()
3303 while(d_mountpoint(root.dentry) && follow_down_one(&root)) in mntns_install()