diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-08 14:03:27 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-09-08 20:20:21 -0400 |
commit | 197df04c749a07616621b762e699b1fff4102fac (patch) | |
tree | 14139723c88d6c706f66f620f174e2880d64ed86 /fs | |
parent | 35759521eedf60ce7d3127c5d33953cd2d1bd35f (diff) |
rename user_path_umountat() to user_path_mountpoint_at()
... and move the extern from linux/namei.h to fs/internal.h,
along with that of vfs_path_lookup().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/internal.h | 3 | ||||
-rw-r--r-- | fs/namei.c | 23 | ||||
-rw-r--r-- | fs/namespace.c | 2 |
3 files changed, 15 insertions, 13 deletions
diff --git a/fs/internal.h b/fs/internal.h index d20893795526..2be46ea5dd0b 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
@@ -45,6 +45,9 @@ extern void __init chrdev_init(void); | |||
45 | * namei.c | 45 | * namei.c |
46 | */ | 46 | */ |
47 | extern int __inode_permission(struct inode *, int); | 47 | extern int __inode_permission(struct inode *, int); |
48 | extern int user_path_mountpoint_at(int, const char __user *, unsigned int, struct path *); | ||
49 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | ||
50 | const char *, unsigned int, struct path *); | ||
48 | 51 | ||
49 | /* | 52 | /* |
50 | * namespace.c | 53 | * namespace.c |
diff --git a/fs/namei.c b/fs/namei.c index 0ab9e6756f3d..11184df3307e 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2223,7 +2223,7 @@ user_path_parent(int dfd, const char __user *path, struct nameidata *nd, | |||
2223 | } | 2223 | } |
2224 | 2224 | ||
2225 | /** | 2225 | /** |
2226 | * umount_lookup_last - look up last component for umount | 2226 | * mountpoint_last - look up last component for umount |
2227 | * @nd: pathwalk nameidata - currently pointing at parent directory of "last" | 2227 | * @nd: pathwalk nameidata - currently pointing at parent directory of "last" |
2228 | * @path: pointer to container for result | 2228 | * @path: pointer to container for result |
2229 | * | 2229 | * |
@@ -2250,7 +2250,7 @@ user_path_parent(int dfd, const char __user *path, struct nameidata *nd, | |||
2250 | * to the link, and nd->path will *not* be put. | 2250 | * to the link, and nd->path will *not* be put. |
2251 | */ | 2251 | */ |
2252 | static int | 2252 | static int |
2253 | umount_lookup_last(struct nameidata *nd, struct path *path) | 2253 | mountpoint_last(struct nameidata *nd, struct path *path) |
2254 | { | 2254 | { |
2255 | int error = 0; | 2255 | int error = 0; |
2256 | struct dentry *dentry; | 2256 | struct dentry *dentry; |
@@ -2312,17 +2312,16 @@ out: | |||
2312 | } | 2312 | } |
2313 | 2313 | ||
2314 | /** | 2314 | /** |
2315 | * path_umountat - look up a path to be umounted | 2315 | * path_mountpoint - look up a path to be umounted |
2316 | * @dfd: directory file descriptor to start walk from | 2316 | * @dfd: directory file descriptor to start walk from |
2317 | * @name: full pathname to walk | 2317 | * @name: full pathname to walk |
2318 | * @flags: lookup flags | 2318 | * @flags: lookup flags |
2319 | * @nd: pathwalk nameidata | ||
2320 | * | 2319 | * |
2321 | * Look up the given name, but don't attempt to revalidate the last component. | 2320 | * Look up the given name, but don't attempt to revalidate the last component. |
2322 | * Returns 0 and "path" will be valid on success; Retuns error otherwise. | 2321 | * Returns 0 and "path" will be valid on success; Retuns error otherwise. |
2323 | */ | 2322 | */ |
2324 | static int | 2323 | static int |
2325 | path_umountat(int dfd, const char *name, struct path *path, unsigned int flags) | 2324 | path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags) |
2326 | { | 2325 | { |
2327 | struct file *base = NULL; | 2326 | struct file *base = NULL; |
2328 | struct nameidata nd; | 2327 | struct nameidata nd; |
@@ -2337,7 +2336,7 @@ path_umountat(int dfd, const char *name, struct path *path, unsigned int flags) | |||
2337 | if (err) | 2336 | if (err) |
2338 | goto out; | 2337 | goto out; |
2339 | 2338 | ||
2340 | err = umount_lookup_last(&nd, path); | 2339 | err = mountpoint_last(&nd, path); |
2341 | while (err > 0) { | 2340 | while (err > 0) { |
2342 | void *cookie; | 2341 | void *cookie; |
2343 | struct path link = *path; | 2342 | struct path link = *path; |
@@ -2348,7 +2347,7 @@ path_umountat(int dfd, const char *name, struct path *path, unsigned int flags) | |||
2348 | err = follow_link(&link, &nd, &cookie); | 2347 | err = follow_link(&link, &nd, &cookie); |
2349 | if (err) | 2348 | if (err) |
2350 | break; | 2349 | break; |
2351 | err = umount_lookup_last(&nd, path); | 2350 | err = mountpoint_last(&nd, path); |
2352 | put_link(&nd, &link, cookie); | 2351 | put_link(&nd, &link, cookie); |
2353 | } | 2352 | } |
2354 | out: | 2353 | out: |
@@ -2362,7 +2361,7 @@ out: | |||
2362 | } | 2361 | } |
2363 | 2362 | ||
2364 | /** | 2363 | /** |
2365 | * user_path_umountat - lookup a path from userland in order to umount it | 2364 | * user_path_mountpoint_at - lookup a path from userland in order to umount it |
2366 | * @dfd: directory file descriptor | 2365 | * @dfd: directory file descriptor |
2367 | * @name: pathname from userland | 2366 | * @name: pathname from userland |
2368 | * @flags: lookup flags | 2367 | * @flags: lookup flags |
@@ -2376,7 +2375,7 @@ out: | |||
2376 | * Returns 0 and populates "path" on success. | 2375 | * Returns 0 and populates "path" on success. |
2377 | */ | 2376 | */ |
2378 | int | 2377 | int |
2379 | user_path_umountat(int dfd, const char __user *name, unsigned int flags, | 2378 | user_path_mountpoint_at(int dfd, const char __user *name, unsigned int flags, |
2380 | struct path *path) | 2379 | struct path *path) |
2381 | { | 2380 | { |
2382 | struct filename *s = getname(name); | 2381 | struct filename *s = getname(name); |
@@ -2385,11 +2384,11 @@ user_path_umountat(int dfd, const char __user *name, unsigned int flags, | |||
2385 | if (IS_ERR(s)) | 2384 | if (IS_ERR(s)) |
2386 | return PTR_ERR(s); | 2385 | return PTR_ERR(s); |
2387 | 2386 | ||
2388 | error = path_umountat(dfd, s->name, path, flags | LOOKUP_RCU); | 2387 | error = path_mountpoint(dfd, s->name, path, flags | LOOKUP_RCU); |
2389 | if (unlikely(error == -ECHILD)) | 2388 | if (unlikely(error == -ECHILD)) |
2390 | error = path_umountat(dfd, s->name, path, flags); | 2389 | error = path_mountpoint(dfd, s->name, path, flags); |
2391 | if (unlikely(error == -ESTALE)) | 2390 | if (unlikely(error == -ESTALE)) |
2392 | error = path_umountat(dfd, s->name, path, flags | LOOKUP_REVAL); | 2391 | error = path_mountpoint(dfd, s->name, path, flags | LOOKUP_REVAL); |
2393 | 2392 | ||
2394 | if (likely(!error)) | 2393 | if (likely(!error)) |
2395 | audit_inode(s, path->dentry, 0); | 2394 | audit_inode(s, path->dentry, 0); |
diff --git a/fs/namespace.c b/fs/namespace.c index fc2b5226278d..25845d1b300b 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -1321,7 +1321,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) | |||
1321 | if (!(flags & UMOUNT_NOFOLLOW)) | 1321 | if (!(flags & UMOUNT_NOFOLLOW)) |
1322 | lookup_flags |= LOOKUP_FOLLOW; | 1322 | lookup_flags |= LOOKUP_FOLLOW; |
1323 | 1323 | ||
1324 | retval = user_path_umountat(AT_FDCWD, name, lookup_flags, &path); | 1324 | retval = user_path_mountpoint_at(AT_FDCWD, name, lookup_flags, &path); |
1325 | if (retval) | 1325 | if (retval) |
1326 | goto out; | 1326 | goto out; |
1327 | mnt = real_mount(path.mnt); | 1327 | mnt = real_mount(path.mnt); |