summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-08 18:16:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-17 12:52:26 -0400
commit2b8910264a7fec4599b620e5206eb877a207f40a (patch)
tree230d48f64871946894cf4a10b5e3be1493a26aaf
parente35d49f637d5ce3d7bb6c735a8d18727e3101f9d (diff)
fhandle: move compat syscalls from compat.c
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/compat.c12
-rw-r--r--fs/fhandle.c13
-rw-r--r--fs/internal.h2
3 files changed, 13 insertions, 14 deletions
diff --git a/fs/compat.c b/fs/compat.c
index e1822ec8a87c..3e94559c452e 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -310,15 +310,3 @@ COMPAT_SYSCALL_DEFINE5(mount, const char __user *, dev_name,
310 out: 310 out:
311 return retval; 311 return retval;
312} 312}
313
314#ifdef CONFIG_FHANDLE
315/*
316 * Exactly like fs/open.c:sys_open_by_handle_at(), except that it
317 * doesn't set the O_LARGEFILE flag.
318 */
319COMPAT_SYSCALL_DEFINE3(open_by_handle_at, int, mountdirfd,
320 struct file_handle __user *, handle, int, flags)
321{
322 return do_handle_open(mountdirfd, handle, flags);
323}
324#endif
diff --git a/fs/fhandle.c b/fs/fhandle.c
index 5559168d5637..58a61f55e0d0 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -9,6 +9,7 @@
9#include <linux/fsnotify.h> 9#include <linux/fsnotify.h>
10#include <linux/personality.h> 10#include <linux/personality.h>
11#include <linux/uaccess.h> 11#include <linux/uaccess.h>
12#include <linux/compat.h>
12#include "internal.h" 13#include "internal.h"
13#include "mount.h" 14#include "mount.h"
14 15
@@ -264,3 +265,15 @@ SYSCALL_DEFINE3(open_by_handle_at, int, mountdirfd,
264 ret = do_handle_open(mountdirfd, handle, flags); 265 ret = do_handle_open(mountdirfd, handle, flags);
265 return ret; 266 return ret;
266} 267}
268
269#ifdef CONFIG_COMPAT
270/*
271 * Exactly like fs/open.c:sys_open_by_handle_at(), except that it
272 * doesn't set the O_LARGEFILE flag.
273 */
274COMPAT_SYSCALL_DEFINE3(open_by_handle_at, int, mountdirfd,
275 struct file_handle __user *, handle, int, flags)
276{
277 return do_handle_open(mountdirfd, handle, flags);
278}
279#endif
diff --git a/fs/internal.h b/fs/internal.h
index 11c6d89dce9c..076751d90ba2 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -108,8 +108,6 @@ extern struct file *do_filp_open(int dfd, struct filename *pathname,
108extern struct file *do_file_open_root(struct dentry *, struct vfsmount *, 108extern struct file *do_file_open_root(struct dentry *, struct vfsmount *,
109 const char *, const struct open_flags *); 109 const char *, const struct open_flags *);
110 110
111extern long do_handle_open(int mountdirfd,
112 struct file_handle __user *ufh, int open_flag);
113extern int open_check_o_direct(struct file *f); 111extern int open_check_o_direct(struct file *f);
114extern int vfs_open(const struct path *, struct file *, const struct cred *); 112extern int vfs_open(const struct path *, struct file *, const struct cred *);
115extern struct file *filp_clone_open(struct file *); 113extern struct file *filp_clone_open(struct file *);