]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
exec: Remove reset_files_struct
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:20 +0000 (17:14 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2024 12:52:47 +0000 (14:52 +0200)
[ Upstream commit 950db38ff2c01b7aabbd7ab4a50b7992750fa63d ]

Now that exec no longer needs to restore the previous value of current->files
on error there are no more callers of reset_files_struct so remove it.

Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-3-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-3-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/file.c
include/linux/fdtable.h

index d6bc73960e4ac9df2258a4344ea5ab386965887c..5065252bb474e4a1ffac77a71bd0bb66dda685c8 100644 (file)
--- a/fs/file.c
+++ b/fs/file.c
@@ -466,18 +466,6 @@ void put_files_struct(struct files_struct *files)
        }
 }
 
-void reset_files_struct(struct files_struct *files)
-{
-       struct task_struct *tsk = current;
-       struct files_struct *old;
-
-       old = tsk->files;
-       task_lock(tsk);
-       tsk->files = files;
-       task_unlock(tsk);
-       put_files_struct(old);
-}
-
 void exit_files(struct task_struct *tsk)
 {
        struct files_struct * files = tsk->files;
index b32ab2163dc2d73d62277b1915d972ca7f0eb76c..c0ca6fb3f0f9568bb7496a5f4b3d3fd15847c344 100644 (file)
@@ -108,7 +108,6 @@ struct task_struct;
 
 struct files_struct *get_files_struct(struct task_struct *);
 void put_files_struct(struct files_struct *fs);
-void reset_files_struct(struct files_struct *);
 int unshare_files(void);
 struct files_struct *dup_fd(struct files_struct *, unsigned, int *) __latent_entropy;
 void do_close_on_exec(struct files_struct *);