diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-07 01:20:27 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 12:57:10 +0400 |
commit | 60545d0d4610b02e55f65d141c95b18ccf855b6e (patch) | |
tree | 252111eed41e5f54a7bd13b054420f750cb5e069 /fs/open.c | |
parent | f9652e10c12b43d9bb957269745cf2fa5682fa92 (diff) | |
download | op-kernel-dev-60545d0d4610b02e55f65d141c95b18ccf855b6e.zip op-kernel-dev-60545d0d4610b02e55f65d141c95b18ccf855b6e.tar.gz |
[O_TMPFILE] it's still short a few helpers, but infrastructure should be OK now...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -840,11 +840,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 { |