Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a218d0fd authored by Al Viro's avatar Al Viro
Browse files

switch open and mkdir syscalls to umode_t



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 04fc66e7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1281,7 +1281,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32,
 * O_LARGEFILE flag.
 */
asmlinkage long
compat_sys_open(const char __user *filename, int flags, int mode)
compat_sys_open(const char __user *filename, int flags, umode_t mode)
{
	return do_sys_open(AT_FDCWD, filename, flags, mode);
}
@@ -1291,7 +1291,7 @@ compat_sys_open(const char __user *filename, int flags, int mode)
 * O_LARGEFILE flag.
 */
asmlinkage long
compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode)
compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, umode_t mode)
{
	return do_sys_open(dfd, filename, flags, mode);
}
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ extern struct file *nameidata_to_filp(struct nameidata *);
extern void release_open_intent(struct nameidata *);
struct open_flags {
	int open_flag;
	int mode;
	umode_t mode;
	int acc_mode;
	int intent;
};
+3 −3
Original line number Diff line number Diff line
@@ -2177,7 +2177,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,

	/* Negative dentry, just create the file */
	if (!dentry->d_inode) {
		int mode = op->mode;
		umode_t mode = op->mode;
		if (!IS_POSIXACL(dir->d_inode))
			mode &= ~current_umask();
		/*
@@ -2562,7 +2562,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
	return error;
}

SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
{
	struct dentry *dentry;
	struct path path;
@@ -2590,7 +2590,7 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode)
	return error;
}

SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode)
SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode)
{
	return sys_mkdirat(AT_FDCWD, pathname, mode);
}
+6 −6
Original line number Diff line number Diff line
@@ -877,7 +877,7 @@ void fd_install(unsigned int fd, struct file *file)

EXPORT_SYMBOL(fd_install);

static inline int build_open_flags(int flags, int mode, struct open_flags *op)
static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)
{
	int lookup_flags = 0;
	int acc_mode;
@@ -948,7 +948,7 @@ static inline int build_open_flags(int flags, int mode, struct open_flags *op)
 * have to.  But in generally you should not do this, so please move
 * along, nothing to see here..
 */
struct file *filp_open(const char *filename, int flags, int mode)
struct file *filp_open(const char *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
@@ -970,7 +970,7 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt,
}
EXPORT_SYMBOL(file_open_root);

long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
	struct open_flags op;
	int lookup = build_open_flags(flags, mode, &op);
@@ -994,7 +994,7 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
	return fd;
}

SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode)
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{
	long ret;

@@ -1008,7 +1008,7 @@ SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode)
}

SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
		int, mode)
		umode_t, mode)
{
	long ret;

@@ -1027,7 +1027,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
 * For backward compatibility?  Maybe this should be moved
 * into arch/i386 instead?
 */
SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode)
SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
{
	return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
}
+2 −2
Original line number Diff line number Diff line
@@ -422,9 +422,9 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *,
				    unsigned int nr_segs, unsigned int flags);
asmlinkage long compat_sys_open(const char __user *filename, int flags,
				int mode);
				umode_t mode);
asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
				  int flags, int mode);
				  int flags, umode_t mode);
asmlinkage long compat_sys_open_by_handle_at(int mountdirfd,
					     struct file_handle __user *handle,
					     int flags);
Loading