[PATCH 04/10] signal: make put_signal_struct() public

From: Tejun Heo
Date: Fri Mar 11 2016 - 10:42:04 EST


This will be used from cgroup while implementing in-process resource
control.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
---
include/linux/sched.h | 2 ++
kernel/fork.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index f1e81e1..80d6ed1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2034,6 +2034,8 @@ static inline int is_global_init(struct task_struct *tsk)

extern struct pid *cad_pid;

+extern void put_signal_struct(struct signal_struct *sig);
+
extern void free_task(struct task_struct *tsk);
#define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0)

diff --git a/kernel/fork.c b/kernel/fork.c
index 2e391c7..fd826de 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -239,7 +239,7 @@ static inline void free_signal_struct(struct signal_struct *sig)
kmem_cache_free(signal_cachep, sig);
}

-static inline void put_signal_struct(struct signal_struct *sig)
+void put_signal_struct(struct signal_struct *sig)
{
if (atomic_dec_and_test(&sig->sigcnt))
free_signal_struct(sig);
--
2.5.0