summaryrefslogtreecommitdiff
path: root/include/linux/fcntl.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-04-27 10:42:24 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-27 12:13:04 +0300
commit80f18379a7c350c011d30332658aa15fe49a8fa5 (patch)
treee458fc2380de4545f8e94608e3c77635d334c053 /include/linux/fcntl.h
parent020c2833dbc76b4069c9a9886b71511052d160df (diff)
downloadlinux-80f18379a7c350c011d30332658aa15fe49a8fa5.tar.xz
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 'include/linux/fcntl.h')
-rw-r--r--include/linux/fcntl.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 76ce329e656d..1b48d9c9a561 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -3,6 +3,12 @@
#include <uapi/linux/fcntl.h>
+/* list of all valid flags for the open/openat flags argument: */
+#define VALID_OPEN_FLAGS \
+ (O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC | \
+ O_APPEND | O_NDELAY | O_NONBLOCK | O_NDELAY | __O_SYNC | O_DSYNC | \
+ FASYNC | O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | \
+ O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
#ifndef force_o_largefile
#define force_o_largefile() (BITS_PER_LONG != 32)