aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/namei.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-05-13 09:12:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-05-15 01:10:45 -0400
commitb853a16176cf3e02c57e215743015614152c2428 (patch)
tree950536eeec92383236f30c6c57052724de24261b /include/linux/namei.h
parent9883d1855ecfafc60045a93abcee6c42e0a5f571 (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.h34
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>
9struct vfsmount; 7#include <linux/errno.h>
10 8
11enum { MAX_NESTED_LINKS = 8 }; 9enum { 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
49extern int user_path_at(int, const char __user *, unsigned, struct path *);
50extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); 47extern 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) 49static 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
55static 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
60static 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
65static 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
57extern int kern_path(const char *, unsigned, struct path *); 71extern int kern_path(const char *, unsigned, struct path *);
58 72