LOOKUP_MOUNTPOINT: fold path_mountpointat() into path_lookupat()

New LOOKUP flag, telling path_lookupat() to act as path_mountpointat().
IOW, traverse mounts at the final point and skip revalidation of the
location where it ends up.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2020-01-11 22:52:26 -05:00
parent cbae4d12ee
commit 161aff1d93
5 changed files with 12 additions and 90 deletions

View File

@@ -186,7 +186,7 @@ static int find_autofs_mount(const char *pathname,
struct path path;
int err;
err = kern_path_mountpoint(AT_FDCWD, pathname, &path, 0);
err = kern_path(pathname, LOOKUP_MOUNTPOINT, &path);
if (err)
return err;
err = -ENOENT;
@@ -519,8 +519,8 @@ static int autofs_dev_ioctl_ismountpoint(struct file *fp,
if (!fp || param->ioctlfd == -1) {
if (autofs_type_any(type))
err = kern_path_mountpoint(AT_FDCWD,
name, &path, LOOKUP_FOLLOW);
err = kern_path(name, LOOKUP_FOLLOW | LOOKUP_MOUNTPOINT,
&path);
else
err = find_autofs_mount(name, &path,
test_by_type, &type);