]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - fs/open.c
keep iocb_flags() result cached in struct file
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 May 2022 15:38:11 +0000 (11:38 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 10 Jun 2022 20:10:23 +0000 (16:10 -0400)
commit164f4064ca81eefcea29f7f5dcf394f92be1d0c0
tree5275b76d52a540bb1e9c91118e6c9510f71d3b2e
parent91b94c5d6ae55d1161633047ffeea644b110b35f
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>
drivers/nvme/target/io-cmd-file.c
fs/aio.c
fs/fcntl.c
fs/file_table.c
fs/io_uring.c
fs/open.c
include/linux/fs.h