summaryrefslogtreecommitdiff
path: root/include/linux/fdtable.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-01-05 05:35:38 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2024-04-15 23:03:24 +0300
commitf60d374d2cc88034385265d193a38e3f4a4b430c (patch)
tree24d9d1dbc2ccc55f62dc86d918130e7e4d8423fb /include/linux/fdtable.h
parent39cd87c4eb2b893354f3b850f916353f2658ae6f (diff)
downloadlinux-f60d374d2cc88034385265d193a38e3f4a4b430c.tar.xz
close_on_exec(): pass files_struct instead of fdtable
both callers are happier that way... Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fdtable.h')
-rw-r--r--include/linux/fdtable.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 78c8326d74ae..cc060b20502b 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -33,11 +33,6 @@ struct fdtable {
struct rcu_head rcu;
};
-static inline bool close_on_exec(unsigned int fd, const struct fdtable *fdt)
-{
- return test_bit(fd, fdt->close_on_exec);
-}
-
static inline bool fd_is_open(unsigned int fd, const struct fdtable *fdt)
{
return test_bit(fd, fdt->open_fds);
@@ -107,6 +102,11 @@ struct file *lookup_fdget_rcu(unsigned int fd);
struct file *task_lookup_fdget_rcu(struct task_struct *task, unsigned int fd);
struct file *task_lookup_next_fdget_rcu(struct task_struct *task, unsigned int *fd);
+static inline bool close_on_exec(unsigned int fd, const struct files_struct *files)
+{
+ return test_bit(fd, files_fdtable(files)->close_on_exec);
+}
+
struct task_struct;
void put_files_struct(struct files_struct *fs);