Lines Matching full:open

39 static bool io_openat_force_async(struct io_open *open)  in io_openat_force_async()  argument
42 * Don't bother trying for O_TRUNC, O_CREAT, or O_TMPFILE open, in io_openat_force_async()
47 return open->how.flags & (O_TRUNC | O_CREAT | __O_TMPFILE); in io_openat_force_async()
52 struct io_open *open = io_kiocb_to_cmd(req, struct io_open); in __io_openat_prep() local
61 /* open.how should be already initialised */ in __io_openat_prep()
62 if (!(open->how.flags & O_PATH) && force_o_largefile()) in __io_openat_prep()
63 open->how.flags |= O_LARGEFILE; in __io_openat_prep()
65 open->dfd = READ_ONCE(sqe->fd); in __io_openat_prep()
67 open->filename = getname(fname); in __io_openat_prep()
68 if (IS_ERR(open->filename)) { in __io_openat_prep()
69 ret = PTR_ERR(open->filename); in __io_openat_prep()
70 open->filename = NULL; in __io_openat_prep()
74 open->file_slot = READ_ONCE(sqe->file_index); in __io_openat_prep()
75 if (open->file_slot && (open->how.flags & O_CLOEXEC)) in __io_openat_prep()
78 open->nofile = rlimit(RLIMIT_NOFILE); in __io_openat_prep()
80 if (io_openat_force_async(open)) in __io_openat_prep()
87 struct io_open *open = io_kiocb_to_cmd(req, struct io_open); in io_openat_prep() local
91 open->how = build_open_how(flags, mode); in io_openat_prep()
97 struct io_open *open = io_kiocb_to_cmd(req, struct io_open); in io_openat2_prep() local
107 ret = copy_struct_from_user(&open->how, sizeof(open->how), how, len); in io_openat2_prep()
116 struct io_open *open = io_kiocb_to_cmd(req, struct io_open); in io_openat2() local
120 bool fixed = !!open->file_slot; in io_openat2()
123 ret = build_open_flags(&open->how, &op); in io_openat2()
127 resolve_nonblock = open->how.resolve & RESOLVE_CACHED; in io_openat2()
129 WARN_ON_ONCE(io_openat_force_async(open)); in io_openat2()
135 ret = __get_unused_fd_flags(open->how.flags, open->nofile); in io_openat2()
140 file = do_filp_open(open->dfd, open->filename, &op); in io_openat2()
165 open->file_slot); in io_openat2()
167 putname(open->filename); in io_openat2()
182 struct io_open *open = io_kiocb_to_cmd(req, struct io_open); in io_open_cleanup() local
184 if (open->filename) in io_open_cleanup()
185 putname(open->filename); in io_open_cleanup()