diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-13 09:12:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-05-15 01:10:45 -0400 |
commit | b853a16176cf3e02c57e215743015614152c2428 (patch) | |
tree | 950536eeec92383236f30c6c57052724de24261b /include/linux/namei.h | |
parent | 9883d1855ecfafc60045a93abcee6c42e0a5f571 (diff) |
turn user_{path_at,path,lpath,path_dir}() into static inlines
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/namei.h')
-rw-r--r-- | include/linux/namei.h | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h index 1208e489f83e..d8c6334cd150 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -1,12 +1,10 @@ | |||
1 | #ifndef _LINUX_NAMEI_H | 1 | #ifndef _LINUX_NAMEI_H |
2 | #define _LINUX_NAMEI_H | 2 | #define _LINUX_NAMEI_H |
3 | 3 | ||
4 | #include <linux/dcache.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/errno.h> | ||
6 | #include <linux/linkage.h> | ||
7 | #include <linux/path.h> | 5 | #include <linux/path.h> |
8 | 6 | #include <linux/fcntl.h> | |
9 | struct vfsmount; | 7 | #include <linux/errno.h> |
10 | 8 | ||
11 | enum { MAX_NESTED_LINKS = 8 }; | 9 | enum { MAX_NESTED_LINKS = 8 }; |
12 | 10 | ||
@@ -46,13 +44,29 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
46 | #define LOOKUP_ROOT 0x2000 | 44 | #define LOOKUP_ROOT 0x2000 |
47 | #define LOOKUP_EMPTY 0x4000 | 45 | #define LOOKUP_EMPTY 0x4000 |
48 | 46 | ||
49 | extern int user_path_at(int, const char __user *, unsigned, struct path *); | ||
50 | extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); | 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) | 49 | static inline int user_path_at(int dfd, const char __user *name, unsigned flags, |
53 | #define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) | 50 | struct path *path) |
54 | #define user_path_dir(name, path) \ | 51 | { |
55 | user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, path) | 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 | extern int kern_path(const char *, unsigned, struct path *); | 71 | extern int kern_path(const char *, unsigned, struct path *); |
58 | 72 | ||