unix_schedule_gc() is only called with NULL as an argument. Simplify by deleting the parameter. Signed-off-by: Nam Cao --- include/net/af_unix.h | 4 ++-- kernel/exit.c | 2 +- net/unix/af_unix.c | 2 +- net/unix/garbage.c | 14 +------------- 4 files changed, 5 insertions(+), 17 deletions(-) diff --git a/include/net/af_unix.h b/include/net/af_unix.h index 686f6f1d1c21..1dfdc0720052 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h @@ -14,14 +14,14 @@ #if IS_ENABLED(CONFIG_UNIX) struct unix_sock *unix_get_socket(struct file *filp); -void unix_schedule_gc(struct user_struct *user); +void unix_schedule_gc(void); #else static inline struct unix_sock *unix_get_socket(struct file *filp) { return NULL; } -static inline void unix_schedule_gc(struct user_struct *user) +static inline void unix_schedule_gc(void) { } #endif diff --git a/kernel/exit.c b/kernel/exit.c index ba9404844523..764a911f111e 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1003,7 +1003,7 @@ void __noreturn do_exit(long code) exit_sem(tsk); exit_shm(tsk); exit_files(tsk); - unix_schedule_gc(NULL); /* Must be after exit_files() */ + unix_schedule_gc(); /* Must be after exit_files() */ exit_fs(tsk); if (group_dead) disassociate_ctty(1); diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index f7a9d55eee8a..759db734a866 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -733,7 +733,7 @@ static void unix_release_sock(struct sock *sk, int embrion) /* ---- Socket is dead now and most probably destroyed ---- */ - unix_schedule_gc(NULL); + unix_schedule_gc(); } struct unix_peercred { diff --git a/net/unix/garbage.c b/net/unix/garbage.c index f180c59b3da9..d46aeb9d2051 100644 --- a/net/unix/garbage.c +++ b/net/unix/garbage.c @@ -635,23 +635,11 @@ static void unix_gc(struct work_struct *work) static DECLARE_WORK(unix_gc_work, unix_gc); -#define UNIX_INFLIGHT_SANE_USER (SCM_MAX_FD * 8) - -void unix_schedule_gc(struct user_struct *user) +void unix_schedule_gc(void) { if (READ_ONCE(unix_graph_state) == UNIX_GRAPH_NOT_CYCLIC) return; - /* Penalise users who want to send AF_UNIX sockets - * but whose sockets have not been received yet. - */ - if (user && - READ_ONCE(user->unix_inflight) < UNIX_INFLIGHT_SANE_USER) - return; - if (!READ_ONCE(gc_in_progress)) queue_work(system_dfl_wq, &unix_gc_work); - - if (user && READ_ONCE(unix_graph_cyclic_sccs)) - flush_work(&unix_gc_work); } -- 2.47.3