diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2022-05-22 11:38:11 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2022-06-10 16:10:23 -0400 |
commit | 164f4064ca81eefcea29f7f5dcf394f92be1d0c0 (patch) | |
tree | 5275b76d52a540bb1e9c91118e6c9510f71d3b2e /fs/aio.c | |
parent | 91b94c5d6ae55d1161633047ffeea644b110b35f (diff) | |
download | lwn-164f4064ca81eefcea29f7f5dcf394f92be1d0c0.tar.gz lwn-164f4064ca81eefcea29f7f5dcf394f92be1d0c0.zip |
keep iocb_flags() result cached in struct file
* calculate at the time we set FMODE_OPENED (do_dentry_open() for normal
opens, alloc_file() for pipe()/socket()/etc.)
* update when handling F_SETFL
* keep in a new field - file->f_iocb_flags; since that thing is needed only
before the refcount reaches zero, we can put it into the same anon union
where ->f_rcuhead and ->f_llist live - those are used only after refcount
reaches zero.
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1475,7 +1475,7 @@ static int aio_prep_rw(struct kiocb *req, const struct iocb *iocb) req->ki_complete = aio_complete_rw; req->private = NULL; req->ki_pos = iocb->aio_offset; - req->ki_flags = iocb_flags(req->ki_filp); + req->ki_flags = req->ki_filp->f_iocb_flags; if (iocb->aio_flags & IOCB_FLAG_RESFD) req->ki_flags |= IOCB_EVENTFD; if (iocb->aio_flags & IOCB_FLAG_IOPRIO) { |