aboutsummaryrefslogtreecommitdiff
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-07 01:20:27 -0400
committerMoyster <oysterized@gmail.com>2019-05-02 15:45:06 +0200
commit59ea0dff75365932014b736b58afd3b425e2a9b5 (patch)
tree3257f5646554995554458ef672d45bd73d4633b4 /fs/open.c
parent5f26faf60ffc3a433b62b2dc5393039a35e21bf9 (diff)
it's still short a few helpers, but infrastructure should be OK now...
Change-Id: I0adb8fe9c5029bad3ac52629003c3b78e9442936 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/open.c b/fs/open.c
index 7b580b493..39f70342f 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -843,11 +843,15 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
if (flags & __O_SYNC)
flags |= O_DSYNC;
- /*
- * If we have O_PATH in the open flag. Then we
- * cannot have anything other than the below set of flags
- */
- if (flags & O_PATH) {
+ if (flags & O_TMPFILE) {
+ if (!(flags & O_CREAT))
+ return -EINVAL;
+ acc_mode = MAY_OPEN | ACC_MODE(flags);
+ } else if (flags & O_PATH) {
+ /*
+ * If we have O_PATH in the open flag. Then we
+ * cannot have anything other than the below set of flags
+ */
flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH;
acc_mode = 0;
} else {