Lines Matching refs:flags
391 static bool access_need_override_creds(int flags) in access_need_override_creds() argument
395 if (flags & AT_EACCESS) in access_need_override_creds()
467 static int do_faccessat(int dfd, const char __user *filename, int mode, int flags) in do_faccessat() argument
478 if (flags & ~(AT_EACCESS | AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH)) in do_faccessat()
481 if (flags & AT_SYMLINK_NOFOLLOW) in do_faccessat()
483 if (flags & AT_EMPTY_PATH) in do_faccessat()
486 if (access_need_override_creds(flags)) { in do_faccessat()
545 int, flags) in SYSCALL_DEFINE4() argument
547 return do_faccessat(dfd, filename, mode, flags); in SYSCALL_DEFINE4()
681 unsigned int flags) in do_fchmodat() argument
687 if (unlikely(flags & ~(AT_SYMLINK_NOFOLLOW | AT_EMPTY_PATH))) in do_fchmodat()
690 lookup_flags = (flags & AT_SYMLINK_NOFOLLOW) ? 0 : LOOKUP_FOLLOW; in do_fchmodat()
691 if (flags & AT_EMPTY_PATH) in do_fchmodat()
708 umode_t, mode, unsigned int, flags) in SYSCALL_DEFINE4() argument
710 return do_fchmodat(dfd, filename, mode, flags); in SYSCALL_DEFINE4()
1107 struct file *dentry_open(const struct path *path, int flags, in dentry_open() argument
1116 f = alloc_empty_file(flags, cred); in dentry_open()
1128 struct file *dentry_open_nonotify(const struct path *path, int flags, in dentry_open_nonotify() argument
1131 struct file *f = alloc_empty_file(flags, cred); in dentry_open_nonotify()
1162 struct file *dentry_create(const struct path *path, int flags, umode_t mode, in dentry_create() argument
1168 f = alloc_empty_file(flags, cred); in dentry_create()
1198 struct file *kernel_file_open(const struct path *path, int flags, in kernel_file_open() argument
1204 f = alloc_empty_file_noaccount(flags, cred); in kernel_file_open()
1217 #define WILL_CREATE(flags) (flags & (O_CREAT | __O_TMPFILE)) argument
1220 inline struct open_how build_open_how(int flags, umode_t mode) in build_open_how() argument
1223 .flags = flags & VALID_OPEN_FLAGS, in build_open_how()
1228 if (how.flags & O_PATH) in build_open_how()
1229 how.flags &= O_PATH_FLAGS; in build_open_how()
1231 if (!WILL_CREATE(how.flags)) in build_open_how()
1238 u64 flags = how->flags; in build_open_flags() local
1241 int acc_mode = ACC_MODE(flags); in build_open_flags()
1249 flags &= ~strip; in build_open_flags()
1256 if (flags & ~VALID_OPEN_FLAGS) in build_open_flags()
1266 if (WILL_CREATE(flags)) { in build_open_flags()
1281 if ((flags & (O_DIRECTORY | O_CREAT)) == (O_DIRECTORY | O_CREAT)) in build_open_flags()
1285 if (flags & __O_TMPFILE) { in build_open_flags()
1291 if (!(flags & O_DIRECTORY)) in build_open_flags()
1296 if (flags & O_PATH) { in build_open_flags()
1298 if (flags & ~O_PATH_FLAGS) in build_open_flags()
1309 if (flags & __O_SYNC) in build_open_flags()
1310 flags |= O_DSYNC; in build_open_flags()
1312 op->open_flag = flags; in build_open_flags()
1315 if (flags & O_TRUNC) in build_open_flags()
1320 if (flags & O_APPEND) in build_open_flags()
1325 op->intent = flags & O_PATH ? 0 : LOOKUP_OPEN; in build_open_flags()
1327 if (flags & O_CREAT) { in build_open_flags()
1329 if (flags & O_EXCL) { in build_open_flags()
1331 flags |= O_NOFOLLOW; in build_open_flags()
1335 if (flags & O_DIRECTORY) in build_open_flags()
1337 if (!(flags & O_NOFOLLOW)) in build_open_flags()
1352 if (flags & (O_TRUNC | O_CREAT | __O_TMPFILE)) in build_open_flags()
1372 struct file *file_open_name(struct filename *name, int flags, umode_t mode) in file_open_name() argument
1375 struct open_how how = build_open_how(flags, mode); in file_open_name()
1393 struct file *filp_open(const char *filename, int flags, umode_t mode) in filp_open() argument
1399 file = file_open_name(name, flags, mode); in filp_open()
1407 const char *filename, int flags, umode_t mode) in file_open_root() argument
1410 struct open_how how = build_open_how(flags, mode); in file_open_root()
1433 fd = get_unused_fd_flags(how->flags); in do_sys_openat2()
1447 int do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) in do_sys_open() argument
1449 struct open_how how = build_open_how(flags, mode); in do_sys_open()
1454 SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) in SYSCALL_DEFINE3() argument
1457 flags |= O_LARGEFILE; in SYSCALL_DEFINE3()
1458 return do_sys_open(AT_FDCWD, filename, flags, mode); in SYSCALL_DEFINE3()
1461 SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, in SYSCALL_DEFINE4() argument
1465 flags |= O_LARGEFILE; in SYSCALL_DEFINE4()
1466 return do_sys_open(dfd, filename, flags, mode); in SYSCALL_DEFINE4()
1490 if (!(tmp.flags & O_PATH) && force_o_largefile()) in SYSCALL_DEFINE4()
1491 tmp.flags |= O_LARGEFILE; in SYSCALL_DEFINE4()
1501 COMPAT_SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) in COMPAT_SYSCALL_DEFINE3() argument
1503 return do_sys_open(AT_FDCWD, filename, flags, mode); in COMPAT_SYSCALL_DEFINE3()
1510 COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, umode_t, mode) in COMPAT_SYSCALL_DEFINE4() argument
1512 return do_sys_open(dfd, filename, flags, mode); in COMPAT_SYSCALL_DEFINE4()
1524 int flags = O_CREAT | O_WRONLY | O_TRUNC; in SYSCALL_DEFINE2() local
1527 flags |= O_LARGEFILE; in SYSCALL_DEFINE2()
1528 return do_sys_open(AT_FDCWD, pathname, flags, mode); in SYSCALL_DEFINE2()