diff options
author | Christoph Hellwig <hch@lst.de> | 2017-07-06 12:58:37 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-08-31 17:32:38 -0400 |
commit | ddef7ed2b5cbafae692d1d580bb5a07808926a9c (patch) | |
tree | b9cc72697712852cb7ef2c27bb1de6d126c2d61f /include/linux | |
parent | 4f59c718521a0f00b6589da6b8fcea2dc296026d (diff) |
annotate RWF_... flags
[AV: added missing annotations in syscalls.h/compat.h]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/compat.h | 16 | ||||
-rw-r--r-- | include/linux/fs.h | 12 | ||||
-rw-r--r-- | include/linux/syscalls.h | 4 |
3 files changed, 23 insertions, 9 deletions
diff --git a/include/linux/compat.h b/include/linux/compat.h index e5d3fbe24f7d..3fc433303d7a 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -365,10 +365,10 @@ asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd, | |||
365 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); | 365 | compat_ulong_t vlen, u32 pos_low, u32 pos_high); |
366 | asmlinkage ssize_t compat_sys_preadv2(compat_ulong_t fd, | 366 | asmlinkage ssize_t compat_sys_preadv2(compat_ulong_t fd, |
367 | const struct compat_iovec __user *vec, | 367 | const struct compat_iovec __user *vec, |
368 | compat_ulong_t vlen, u32 pos_low, u32 pos_high, int flags); | 368 | compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags); |
369 | asmlinkage ssize_t compat_sys_pwritev2(compat_ulong_t fd, | 369 | asmlinkage ssize_t compat_sys_pwritev2(compat_ulong_t fd, |
370 | const struct compat_iovec __user *vec, | 370 | const struct compat_iovec __user *vec, |
371 | compat_ulong_t vlen, u32 pos_low, u32 pos_high, int flags); | 371 | compat_ulong_t vlen, u32 pos_low, u32 pos_high, rwf_t flags); |
372 | 372 | ||
373 | #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64 | 373 | #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64 |
374 | asmlinkage long compat_sys_preadv64(unsigned long fd, | 374 | asmlinkage long compat_sys_preadv64(unsigned long fd, |
@@ -382,6 +382,18 @@ asmlinkage long compat_sys_pwritev64(unsigned long fd, | |||
382 | unsigned long vlen, loff_t pos); | 382 | unsigned long vlen, loff_t pos); |
383 | #endif | 383 | #endif |
384 | 384 | ||
385 | #ifdef __ARCH_WANT_COMPAT_SYS_PREADV64V2 | ||
386 | asmlinkage long compat_sys_readv64v2(unsigned long fd, | ||
387 | const struct compat_iovec __user *vec, | ||
388 | unsigned long vlen, loff_t pos, rwf_t flags); | ||
389 | #endif | ||
390 | |||
391 | #ifdef __ARCH_WANT_COMPAT_SYS_PWRITEV64V2 | ||
392 | asmlinkage long compat_sys_pwritev64v2(unsigned long fd, | ||
393 | const struct compat_iovec __user *vec, | ||
394 | unsigned long vlen, loff_t pos, rwf_t flags); | ||
395 | #endif | ||
396 | |||
385 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); | 397 | asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int); |
386 | 398 | ||
387 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, | 399 | asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index cbfe127bccf8..2625fc47c7e5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -72,6 +72,8 @@ extern int leases_enable, lease_break_time; | |||
72 | extern int sysctl_protected_symlinks; | 72 | extern int sysctl_protected_symlinks; |
73 | extern int sysctl_protected_hardlinks; | 73 | extern int sysctl_protected_hardlinks; |
74 | 74 | ||
75 | typedef __kernel_rwf_t rwf_t; | ||
76 | |||
75 | struct buffer_head; | 77 | struct buffer_head; |
76 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, | 78 | typedef int (get_block_t)(struct inode *inode, sector_t iblock, |
77 | struct buffer_head *bh_result, int create); | 79 | struct buffer_head *bh_result, int create); |
@@ -1758,9 +1760,9 @@ extern ssize_t __vfs_write(struct file *, const char __user *, size_t, loff_t *) | |||
1758 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1760 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1759 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1761 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
1760 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, | 1762 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, |
1761 | unsigned long, loff_t *, int); | 1763 | unsigned long, loff_t *, rwf_t); |
1762 | extern ssize_t vfs_writev(struct file *, const struct iovec __user *, | 1764 | extern ssize_t vfs_writev(struct file *, const struct iovec __user *, |
1763 | unsigned long, loff_t *, int); | 1765 | unsigned long, loff_t *, rwf_t); |
1764 | extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, | 1766 | extern ssize_t vfs_copy_file_range(struct file *, loff_t , struct file *, |
1765 | loff_t, size_t, unsigned int); | 1767 | loff_t, size_t, unsigned int); |
1766 | extern int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in, | 1768 | extern int vfs_clone_file_prep_inodes(struct inode *inode_in, loff_t pos_in, |
@@ -2874,9 +2876,9 @@ extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *); | |||
2874 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); | 2876 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); |
2875 | 2877 | ||
2876 | ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos, | 2878 | ssize_t vfs_iter_read(struct file *file, struct iov_iter *iter, loff_t *ppos, |
2877 | int flags); | 2879 | rwf_t flags); |
2878 | ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos, | 2880 | ssize_t vfs_iter_write(struct file *file, struct iov_iter *iter, loff_t *ppos, |
2879 | int flags); | 2881 | rwf_t flags); |
2880 | 2882 | ||
2881 | /* fs/block_dev.c */ | 2883 | /* fs/block_dev.c */ |
2882 | extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); | 2884 | extern ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to); |
@@ -3143,7 +3145,7 @@ static inline int iocb_flags(struct file *file) | |||
3143 | return res; | 3145 | return res; |
3144 | } | 3146 | } |
3145 | 3147 | ||
3146 | static inline int kiocb_set_rw_flags(struct kiocb *ki, int flags) | 3148 | static inline int kiocb_set_rw_flags(struct kiocb *ki, rwf_t flags) |
3147 | { | 3149 | { |
3148 | if (unlikely(flags & ~RWF_SUPPORTED)) | 3150 | if (unlikely(flags & ~RWF_SUPPORTED)) |
3149 | return -EOPNOTSUPP; | 3151 | return -EOPNOTSUPP; |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 0bc1d2e8cc17..138c94535864 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -579,12 +579,12 @@ asmlinkage long sys_preadv(unsigned long fd, const struct iovec __user *vec, | |||
579 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); | 579 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); |
580 | asmlinkage long sys_preadv2(unsigned long fd, const struct iovec __user *vec, | 580 | asmlinkage long sys_preadv2(unsigned long fd, const struct iovec __user *vec, |
581 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h, | 581 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h, |
582 | int flags); | 582 | rwf_t flags); |
583 | asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, | 583 | asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, |
584 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); | 584 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h); |
585 | asmlinkage long sys_pwritev2(unsigned long fd, const struct iovec __user *vec, | 585 | asmlinkage long sys_pwritev2(unsigned long fd, const struct iovec __user *vec, |
586 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h, | 586 | unsigned long vlen, unsigned long pos_l, unsigned long pos_h, |
587 | int flags); | 587 | rwf_t flags); |
588 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); | 588 | asmlinkage long sys_getcwd(char __user *buf, unsigned long size); |
589 | asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode); | 589 | asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode); |
590 | asmlinkage long sys_chdir(const char __user *filename); | 590 | asmlinkage long sys_chdir(const char __user *filename); |