summaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-27 03:42:24 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-27 05:13:04 -0400
commit80f18379a7c350c011d30332658aa15fe49a8fa5 (patch)
treee458fc2380de4545f8e94608e3c77635d334c053 /fs/fcntl.c
parent020c2833dbc76b4069c9a9886b71511052d160df (diff)
fs: add a VALID_OPEN_FLAGS
Add a central define for all valid open flags, and use it in the uniqueness check. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r--fs/fcntl.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index be8fbe289087..de1b16bb6a29 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -742,16 +742,10 @@ static int __init fcntl_init(void)
742 * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY 742 * Exceptions: O_NONBLOCK is a two bit define on parisc; O_NDELAY
743 * is defined as O_NONBLOCK on some platforms and not on others. 743 * is defined as O_NONBLOCK on some platforms and not on others.
744 */ 744 */
745 BUILD_BUG_ON(21 - 1 /* for O_RDONLY being 0 */ != HWEIGHT32( 745 BUILD_BUG_ON(21 - 1 /* for O_RDONLY being 0 */ !=
746 O_RDONLY | O_WRONLY | O_RDWR | 746 HWEIGHT32(
747 O_CREAT | O_EXCL | O_NOCTTY | 747 (VALID_OPEN_FLAGS & ~(O_NONBLOCK | O_NDELAY)) |
748 O_TRUNC | O_APPEND | /* O_NONBLOCK | */ 748 __FMODE_EXEC | __FMODE_NONOTIFY));
749 __O_SYNC | O_DSYNC | FASYNC |
750 O_DIRECT | O_LARGEFILE | O_DIRECTORY |
751 O_NOFOLLOW | O_NOATIME | O_CLOEXEC |
752 __FMODE_EXEC | O_PATH | __O_TMPFILE |
753 __FMODE_NONOTIFY
754 ));
755 749
756 fasync_cache = kmem_cache_create("fasync_cache", 750 fasync_cache = kmem_cache_create("fasync_cache",
757 sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL); 751 sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL);