|
1 | 1 | #ifndef _LINUX_NAMEI_H
|
2 | 2 | #define _LINUX_NAMEI_H
|
3 | 3 |
|
4 |
| -#include <linux/dcache.h> |
5 |
| -#include <linux/errno.h> |
6 |
| -#include <linux/linkage.h> |
| 4 | +#include <linux/kernel.h> |
7 | 5 | #include <linux/path.h>
|
8 |
| - |
9 |
| -struct vfsmount; |
| 6 | +#include <linux/fcntl.h> |
| 7 | +#include <linux/errno.h> |
10 | 8 |
|
11 | 9 | enum { MAX_NESTED_LINKS = 8 };
|
12 | 10 |
|
@@ -46,13 +44,29 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
|
46 | 44 | #define LOOKUP_ROOT 0x2000
|
47 | 45 | #define LOOKUP_EMPTY 0x4000
|
48 | 46 |
|
49 |
| -extern int user_path_at(int, const char __user *, unsigned, struct path *); |
50 | 47 | extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
|
51 | 48 |
|
52 |
| -#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) |
53 |
| -#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) |
54 |
| -#define user_path_dir(name, path) \ |
55 |
| - user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) |
| 49 | +static inline int user_path_at(int dfd, const char __user *name, unsigned flags, |
| 50 | + struct path *path) |
| 51 | +{ |
| 52 | + return user_path_at_empty(dfd, name, flags, path, NULL); |
| 53 | +} |
| 54 | + |
| 55 | +static inline int user_path(const char __user *name, struct path *path) |
| 56 | +{ |
| 57 | + return user_path_at_empty(AT_FDCWD, name, LOOKUP_FOLLOW, path, NULL); |
| 58 | +} |
| 59 | + |
| 60 | +static inline int user_lpath(const char __user *name, struct path *path) |
| 61 | +{ |
| 62 | + return user_path_at_empty(AT_FDCWD, name, 0, path, NULL); |
| 63 | +} |
| 64 | + |
| 65 | +static inline int user_path_dir(const char __user *name, struct path *path) |
| 66 | +{ |
| 67 | + return user_path_at_empty(AT_FDCWD, name, |
| 68 | + LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path, NULL); |
| 69 | +} |
56 | 70 |
|
57 | 71 | extern int kern_path(const char *, unsigned, struct path *);
|
58 | 72 |
|
|
0 commit comments