Lines Matching refs:path
678 * mount @o after path lookup but before @namespace_sem could be
700 * lookup_mnt - Return the first child mount mounted at path
715 struct vfsmount *lookup_mnt(const struct path *path)
724 child_mnt = __lookup_mnt(path->mnt, path->dentry);
1375 * path_is_mountpoint() - Check if path is a mount in the current namespace.
1376 * @path: path to check
1382 * checks if the passed in path is a mountpoint rather than the dentry
1385 bool path_is_mountpoint(const struct path *path)
1390 if (!d_mountpoint(path->dentry))
1396 res = __path_is_mountpoint(path);
1404 struct vfsmount *mnt_clone_internal(const struct path *path)
1407 p = clone_mnt(real_mount(path->mnt), path->dentry, CL_PRIVATE);
1806 * During unlink, rmdir, and d_drop it is possible to loose the path
1848 * path_mounted - check whether path is mounted
1849 * @path: path to check
1851 * Determine whether @path refers to the root of a mount.
1853 * Return: true if @path is the root of a mount, false if not.
1855 static inline bool path_mounted(const struct path *path)
1857 return path->mnt->mnt_root == path->dentry;
1869 static int can_umount(const struct path *path, int flags)
1871 struct mount *mnt = real_mount(path->mnt);
1875 if (!path_mounted(path))
1887 int path_umount(struct path *path, int flags)
1889 struct mount *mnt = real_mount(path->mnt);
1892 ret = can_umount(path, flags);
1897 dput(path->dentry);
1905 struct path path;
1914 ret = user_path_at(AT_FDCWD, name, lookup_flags, &path);
1917 return path_umount(&path, flags);
2034 struct vfsmount *collect_mounts(const struct path *path)
2038 if (!check_mnt(real_mount(path->mnt)))
2041 tree = copy_tree(real_mount(path->mnt), path->dentry,
2094 * clone_private_mount - create a private clone of a path
2095 * @path: path to clone
2097 * This creates a new vfsmount, which will be the clone of @path. The new mount
2103 struct vfsmount *clone_private_mount(const struct path *path)
2105 struct mount *old_mnt = real_mount(path->mnt);
2115 if (has_locked_children(old_mnt, path->dentry))
2118 new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
2404 * @path: target path
2405 * @beneath: whether the intention is to mount beneath @path
2407 * Follow the mount stack on @path until the top mount @mnt is found. If
2408 * the initial @path->{mnt,dentry} is a mountpoint lookup the first
2436 static struct mountpoint *do_lock_mount(struct path *path, bool beneath)
2438 struct vfsmount *mnt = path->mnt;
2451 dentry = path->dentry;
2468 mnt = lookup_mnt(path);
2476 path_put(path);
2477 path->mnt = mnt;
2478 path->dentry = dget(mnt->mnt_root);
2494 static inline struct mountpoint *lock_mount(struct path *path)
2496 return do_lock_mount(path, false);
2543 static int do_change_type(struct path *path, int ms_flags)
2546 struct mount *mnt = real_mount(path->mnt);
2551 if (!path_mounted(path))
2575 static struct mount *__do_loopback(struct path *old_path, int recurse)
2602 static int do_loopback(struct path *path, const char *old_name,
2605 struct path old_path;
2619 mp = lock_mount(path);
2625 parent = real_mount(path->mnt);
2648 static struct file *open_detached_copy(struct path *path, bool recursive)
2659 mnt = __do_loopback(path, recursive);
2677 mntput(path->mnt);
2678 path->mnt = &mnt->mnt;
2679 file = dentry_open(path, O_PATH, current_cred());
2681 dissolve_on_fput(path->mnt);
2690 struct path path;
2720 error = user_path_at(dfd, filename, lookup_flags, &path);
2725 file = open_detached_copy(&path, flags & AT_RECURSIVE);
2727 file = dentry_open(&path, O_PATH, current_cred());
2728 path_put(&path);
2792 static void mnt_warn_timestamp_expiry(struct path *mountpoint, struct vfsmount *mnt)
2818 static int do_reconfigure_mnt(struct path *path, unsigned int mnt_flags)
2820 struct super_block *sb = path->mnt->mnt_sb;
2821 struct mount *mnt = real_mount(path->mnt);
2827 if (!path_mounted(path))
2845 mnt_warn_timestamp_expiry(path, &mnt->mnt);
2855 static int do_remount(struct path *path, int ms_flags, int sb_flags,
2859 struct super_block *sb = path->mnt->mnt_sb;
2860 struct mount *mnt = real_mount(path->mnt);
2866 if (!path_mounted(path))
2872 fc = fs_context_for_reconfigure(path->dentry, sb_flags, MS_RMT_MASK);
2897 mnt_warn_timestamp_expiry(path, &mnt->mnt);
2935 static int do_set_group(struct path *from_path, struct path *to_path)
3008 * path_overmounted - check if path is overmounted
3009 * @path: path to check
3011 * Check if path is overmounted, i.e., if there's a mount on top of
3012 * @path->mnt with @path->dentry as mountpoint.
3015 * Return: If path is overmounted true is returned, false if not.
3017 static inline bool path_overmounted(const struct path *path)
3020 if (unlikely(__lookup_mnt(path->mnt, path->dentry))) {
3048 static int can_move_mount_beneath(const struct path *from,
3049 const struct path *to,
3109 static int do_move_mount(struct path *old_path, struct path *new_path,
3205 static int do_move_mount_old(struct path *path, const char *old_name)
3207 struct path old_path;
3217 err = do_move_mount(&old_path, path, false);
3226 const struct path *path, int mnt_flags)
3228 struct mount *parent = real_mount(path->mnt);
3242 if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb && path_mounted(path))
3258 static int do_new_mount_fc(struct fs_context *fc, struct path *mountpoint,
3299 static int do_new_mount(struct path *path, const char *fstype, int sb_flags,
3348 err = do_new_mount_fc(fc, path, mnt_flags);
3354 int finish_automount(struct vfsmount *m, const struct path *path)
3356 struct dentry *dentry = path->dentry;
3372 if (m->mnt_sb == path->mnt->mnt_sb &&
3389 if (path_overmounted(path)) {
3399 err = do_add_mount(mnt, mp, path, path->mnt->mnt_flags | MNT_SHRINKABLE);
3598 int path_mount(const char *dev_name, struct path *path,
3615 ret = security_sb_mount(dev_name, path, type_page, flags, data_page);
3650 mnt_flags |= path->mnt->mnt_flags & MNT_ATIME_MASK;
3663 return do_reconfigure_mnt(path, mnt_flags);
3665 return do_remount(path, flags, sb_flags, mnt_flags, data_page);
3667 return do_loopback(path, dev_name, flags & MS_REC);
3669 return do_change_type(path, flags);
3671 return do_move_mount_old(path, dev_name);
3673 return do_new_mount(path, type_page, sb_flags, mnt_flags, dev_name,
3680 struct path path;
3683 ret = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
3686 ret = path_mount(dev_name, &path, type_page, flags, data_page);
3687 path_put(&path);
3840 struct path path;
3854 name, LOOKUP_FOLLOW|LOOKUP_AUTOMOUNT, &path);
3862 s = path.mnt->mnt_sb;
3864 mntput(path.mnt);
3868 return path.dentry;
3946 struct path newmount;
4074 struct path from_path, to_path;
4128 * Return true if path is reachable from root
4133 const struct path *root)
4142 bool path_is_under(const struct path *path1, const struct path *path2)
4180 struct path new, old, root;
4431 static int do_mount_setattr(struct path *path, struct mount_kattr *kattr)
4433 struct mount *mnt = real_mount(path->mnt);
4436 if (!path_mounted(path))
4645 SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path,
4650 struct path target;
4684 err = user_path_at(dfd, path, kattr.lookup_flags, &target);
4698 struct path root;
4812 struct path ns_root;
4813 struct path fs_root;
4965 struct path root;