diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-21 14:59:34 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:55:19 -0500 |
commit | a218d0fdc5f9004164ff151d274487f6799907d0 (patch) | |
tree | 24ea22ffb4aadb1fedff50c4a7fcb17af1981459 | |
parent | 04fc66e789a896e684bfdca30208e57eb832dd96 (diff) |
switch open and mkdir syscalls to umode_t
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/compat.c | 4 | ||||
-rw-r--r-- | fs/internal.h | 2 | ||||
-rw-r--r-- | fs/namei.c | 6 | ||||
-rw-r--r-- | fs/open.c | 12 | ||||
-rw-r--r-- | include/linux/compat.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 4 | ||||
-rw-r--r-- | include/linux/syscalls.h | 10 |
7 files changed, 21 insertions, 21 deletions
diff --git a/fs/compat.c b/fs/compat.c index 9db5a6076610..fa9d721ecfee 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1281,7 +1281,7 @@ compat_sys_vmsplice(int fd, const struct compat_iovec __user *iov32, | |||
1281 | * O_LARGEFILE flag. | 1281 | * O_LARGEFILE flag. |
1282 | */ | 1282 | */ |
1283 | asmlinkage long | 1283 | asmlinkage long |
1284 | compat_sys_open(const char __user *filename, int flags, int mode) | 1284 | compat_sys_open(const char __user *filename, int flags, umode_t mode) |
1285 | { | 1285 | { |
1286 | return do_sys_open(AT_FDCWD, filename, flags, mode); | 1286 | return do_sys_open(AT_FDCWD, filename, flags, mode); |
1287 | } | 1287 | } |
@@ -1291,7 +1291,7 @@ compat_sys_open(const char __user *filename, int flags, int mode) | |||
1291 | * O_LARGEFILE flag. | 1291 | * O_LARGEFILE flag. |
1292 | */ | 1292 | */ |
1293 | asmlinkage long | 1293 | asmlinkage long |
1294 | compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode) | 1294 | compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, umode_t mode) |
1295 | { | 1295 | { |
1296 | return do_sys_open(dfd, filename, flags, mode); | 1296 | return do_sys_open(dfd, filename, flags, mode); |
1297 | } | 1297 | } |
diff --git a/fs/internal.h b/fs/internal.h index 7b1cb1528ac2..23599f88d1a5 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
@@ -88,7 +88,7 @@ extern struct file *nameidata_to_filp(struct nameidata *); | |||
88 | extern void release_open_intent(struct nameidata *); | 88 | extern void release_open_intent(struct nameidata *); |
89 | struct open_flags { | 89 | struct open_flags { |
90 | int open_flag; | 90 | int open_flag; |
91 | int mode; | 91 | umode_t mode; |
92 | int acc_mode; | 92 | int acc_mode; |
93 | int intent; | 93 | int intent; |
94 | }; | 94 | }; |
diff --git a/fs/namei.c b/fs/namei.c index e275dc36d7c5..afd5876cd072 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2177,7 +2177,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, | |||
2177 | 2177 | ||
2178 | /* Negative dentry, just create the file */ | 2178 | /* Negative dentry, just create the file */ |
2179 | if (!dentry->d_inode) { | 2179 | if (!dentry->d_inode) { |
2180 | int mode = op->mode; | 2180 | umode_t mode = op->mode; |
2181 | if (!IS_POSIXACL(dir->d_inode)) | 2181 | if (!IS_POSIXACL(dir->d_inode)) |
2182 | mode &= ~current_umask(); | 2182 | mode &= ~current_umask(); |
2183 | /* | 2183 | /* |
@@ -2562,7 +2562,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
2562 | return error; | 2562 | return error; |
2563 | } | 2563 | } |
2564 | 2564 | ||
2565 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) | 2565 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) |
2566 | { | 2566 | { |
2567 | struct dentry *dentry; | 2567 | struct dentry *dentry; |
2568 | struct path path; | 2568 | struct path path; |
@@ -2590,7 +2590,7 @@ out_dput: | |||
2590 | return error; | 2590 | return error; |
2591 | } | 2591 | } |
2592 | 2592 | ||
2593 | SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) | 2593 | SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode) |
2594 | { | 2594 | { |
2595 | return sys_mkdirat(AT_FDCWD, pathname, mode); | 2595 | return sys_mkdirat(AT_FDCWD, pathname, mode); |
2596 | } | 2596 | } |
@@ -877,7 +877,7 @@ void fd_install(unsigned int fd, struct file *file) | |||
877 | 877 | ||
878 | EXPORT_SYMBOL(fd_install); | 878 | EXPORT_SYMBOL(fd_install); |
879 | 879 | ||
880 | static inline int build_open_flags(int flags, int mode, struct open_flags *op) | 880 | static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op) |
881 | { | 881 | { |
882 | int lookup_flags = 0; | 882 | int lookup_flags = 0; |
883 | int acc_mode; | 883 | int acc_mode; |
@@ -948,7 +948,7 @@ static inline int build_open_flags(int flags, int mode, struct open_flags *op) | |||
948 | * have to. But in generally you should not do this, so please move | 948 | * have to. But in generally you should not do this, so please move |
949 | * along, nothing to see here.. | 949 | * along, nothing to see here.. |
950 | */ | 950 | */ |
951 | struct file *filp_open(const char *filename, int flags, int mode) | 951 | struct file *filp_open(const char *filename, int flags, umode_t mode) |
952 | { | 952 | { |
953 | struct open_flags op; | 953 | struct open_flags op; |
954 | int lookup = build_open_flags(flags, mode, &op); | 954 | int lookup = build_open_flags(flags, mode, &op); |
@@ -970,7 +970,7 @@ struct file *file_open_root(struct dentry *dentry, struct vfsmount *mnt, | |||
970 | } | 970 | } |
971 | EXPORT_SYMBOL(file_open_root); | 971 | EXPORT_SYMBOL(file_open_root); |
972 | 972 | ||
973 | long do_sys_open(int dfd, const char __user *filename, int flags, int mode) | 973 | long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) |
974 | { | 974 | { |
975 | struct open_flags op; | 975 | struct open_flags op; |
976 | int lookup = build_open_flags(flags, mode, &op); | 976 | 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) | |||
994 | return fd; | 994 | return fd; |
995 | } | 995 | } |
996 | 996 | ||
997 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) | 997 | SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) |
998 | { | 998 | { |
999 | long ret; | 999 | long ret; |
1000 | 1000 | ||
@@ -1008,7 +1008,7 @@ SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) | |||
1008 | } | 1008 | } |
1009 | 1009 | ||
1010 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, | 1010 | SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, |
1011 | int, mode) | 1011 | umode_t, mode) |
1012 | { | 1012 | { |
1013 | long ret; | 1013 | long ret; |
1014 | 1014 | ||
@@ -1027,7 +1027,7 @@ SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, | |||
1027 | * For backward compatibility? Maybe this should be moved | 1027 | * For backward compatibility? Maybe this should be moved |
1028 | * into arch/i386 instead? | 1028 | * into arch/i386 instead? |
1029 | */ | 1029 | */ |
1030 | SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) | 1030 | SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode) |
1031 | { | 1031 | { |
1032 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); | 1032 | return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); |
1033 | } | 1033 | } |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 66ed067fb729..41c9f6515f46 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -422,9 +422,9 @@ asmlinkage long compat_sys_getdents64(unsigned int fd, | |||
422 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, | 422 | asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, |
423 | unsigned int nr_segs, unsigned int flags); | 423 | unsigned int nr_segs, unsigned int flags); |
424 | asmlinkage long compat_sys_open(const char __user *filename, int flags, | 424 | asmlinkage long compat_sys_open(const char __user *filename, int flags, |
425 | int mode); | 425 | umode_t mode); |
426 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, | 426 | asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, |
427 | int flags, int mode); | 427 | int flags, umode_t mode); |
428 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, | 428 | asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, |
429 | struct file_handle __user *handle, | 429 | struct file_handle __user *handle, |
430 | int flags); | 430 | int flags); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9d02fab420c6..f0e57b7e4297 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2054,8 +2054,8 @@ extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | |||
2054 | extern int do_fallocate(struct file *file, int mode, loff_t offset, | 2054 | extern int do_fallocate(struct file *file, int mode, loff_t offset, |
2055 | loff_t len); | 2055 | loff_t len); |
2056 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 2056 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
2057 | int mode); | 2057 | umode_t mode); |
2058 | extern struct file *filp_open(const char *, int, int); | 2058 | extern struct file *filp_open(const char *, int, umode_t); |
2059 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | 2059 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, |
2060 | const char *, int); | 2060 | const char *, int); |
2061 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | 2061 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b25621476316..515669fa3c1d 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -517,9 +517,9 @@ asmlinkage long sys_sendfile64(int out_fd, int in_fd, | |||
517 | loff_t __user *offset, size_t count); | 517 | loff_t __user *offset, size_t count); |
518 | asmlinkage long sys_readlink(const char __user *path, | 518 | asmlinkage long sys_readlink(const char __user *path, |
519 | char __user *buf, int bufsiz); | 519 | char __user *buf, int bufsiz); |
520 | asmlinkage long sys_creat(const char __user *pathname, int mode); | 520 | asmlinkage long sys_creat(const char __user *pathname, umode_t mode); |
521 | asmlinkage long sys_open(const char __user *filename, | 521 | asmlinkage long sys_open(const char __user *filename, |
522 | int flags, int mode); | 522 | int flags, umode_t mode); |
523 | asmlinkage long sys_close(unsigned int fd); | 523 | asmlinkage long sys_close(unsigned int fd); |
524 | asmlinkage long sys_access(const char __user *filename, int mode); | 524 | asmlinkage long sys_access(const char __user *filename, int mode); |
525 | asmlinkage long sys_vhangup(void); | 525 | asmlinkage long sys_vhangup(void); |
@@ -582,7 +582,7 @@ asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec, | |||
582 | asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, | 582 | asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, |
583 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); | 583 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); |
584 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); | 584 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); |
585 | asmlinkage long sys_mkdir(const char __user *pathname, int mode); | 585 | asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode); |
586 | asmlinkage long sys_chdir(const char __user *filename); | 586 | asmlinkage long sys_chdir(const char __user *filename); |
587 | asmlinkage long sys_fchdir(unsigned int fd); | 587 | asmlinkage long sys_fchdir(unsigned int fd); |
588 | asmlinkage long sys_rmdir(const char __user *pathname); | 588 | asmlinkage long sys_rmdir(const char __user *pathname); |
@@ -757,7 +757,7 @@ asmlinkage long sys_spu_create(const char __user *name, | |||
757 | 757 | ||
758 | asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode, | 758 | asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode, |
759 | unsigned dev); | 759 | unsigned dev); |
760 | asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, int mode); | 760 | asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, umode_t mode); |
761 | asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); | 761 | asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); |
762 | asmlinkage long sys_symlinkat(const char __user * oldname, | 762 | asmlinkage long sys_symlinkat(const char __user * oldname, |
763 | int newdfd, const char __user * newname); | 763 | int newdfd, const char __user * newname); |
@@ -773,7 +773,7 @@ asmlinkage long sys_fchmodat(int dfd, const char __user * filename, | |||
773 | asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, | 773 | asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, |
774 | gid_t group, int flag); | 774 | gid_t group, int flag); |
775 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | 775 | asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, |
776 | int mode); | 776 | umode_t mode); |
777 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, | 777 | asmlinkage long sys_newfstatat(int dfd, const char __user *filename, |
778 | struct stat __user *statbuf, int flag); | 778 | struct stat __user *statbuf, int flag); |
779 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, | 779 | asmlinkage long sys_fstatat64(int dfd, const char __user *filename, |