2012-11-19 10:44:52

by Gao feng

[permalink] [raw]
Subject: [PATCH] pidns: remove the useless function is_container_init

since commit 1cdcbec1a3372c0c49c59d292e708fd07b509f18,
is_container_init has no used for a long time.

just remove it.

Signed-off-by: Gao feng <[email protected]>
---
include/linux/sched.h | 6 ------
kernel/pid.c | 15 ---------------
2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0dd42a0..3fadd26 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1710,12 +1710,6 @@ static inline int is_global_init(struct task_struct *tsk)
return tsk->pid == 1;
}

-/*
- * is_container_init:
- * check whether in the task is init in its own pid namespace.
- */
-extern int is_container_init(struct task_struct *tsk);
-
extern struct pid *cad_pid;

extern void free_task(struct task_struct *tsk);
diff --git a/kernel/pid.c b/kernel/pid.c
index aebd4f5..8ccdf0e 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -81,21 +81,6 @@ struct pid_namespace init_pid_ns = {
};
EXPORT_SYMBOL_GPL(init_pid_ns);

-int is_container_init(struct task_struct *tsk)
-{
- int ret = 0;
- struct pid *pid;
-
- rcu_read_lock();
- pid = task_pid(tsk);
- if (pid != NULL && pid->numbers[pid->level].nr == 1)
- ret = 1;
- rcu_read_unlock();
-
- return ret;
-}
-EXPORT_SYMBOL(is_container_init);
-
/*
* Note: disable interrupts while the pidmap_lock is held as an
* interrupt might come in and do read_lock(&tasklist_lock).
--
1.7.7.6


2012-11-19 14:08:24

by Serge E. Hallyn

[permalink] [raw]
Subject: Re: [PATCH] pidns: remove the useless function is_container_init

Quoting Gao feng ([email protected]):
> since commit 1cdcbec1a3372c0c49c59d292e708fd07b509f18,
> is_container_init has no used for a long time.
>
> just remove it.

Only thing is it's being exported, so I think it needs to go through
deprecation.

> Signed-off-by: Gao feng <[email protected]>
> ---
> include/linux/sched.h | 6 ------
> kernel/pid.c | 15 ---------------
> 2 files changed, 0 insertions(+), 21 deletions(-)
>
> diff --git a/include/linux/sched.h b/include/linux/sched.h
> index 0dd42a0..3fadd26 100644
> --- a/include/linux/sched.h
> +++ b/include/linux/sched.h
> @@ -1710,12 +1710,6 @@ static inline int is_global_init(struct task_struct *tsk)
> return tsk->pid == 1;
> }
>
> -/*
> - * is_container_init:
> - * check whether in the task is init in its own pid namespace.
> - */
> -extern int is_container_init(struct task_struct *tsk);
> -
> extern struct pid *cad_pid;
>
> extern void free_task(struct task_struct *tsk);
> diff --git a/kernel/pid.c b/kernel/pid.c
> index aebd4f5..8ccdf0e 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -81,21 +81,6 @@ struct pid_namespace init_pid_ns = {
> };
> EXPORT_SYMBOL_GPL(init_pid_ns);
>
> -int is_container_init(struct task_struct *tsk)
> -{
> - int ret = 0;
> - struct pid *pid;
> -
> - rcu_read_lock();
> - pid = task_pid(tsk);
> - if (pid != NULL && pid->numbers[pid->level].nr == 1)
> - ret = 1;
> - rcu_read_unlock();
> -
> - return ret;
> -}
> -EXPORT_SYMBOL(is_container_init);
> -
> /*
> * Note: disable interrupts while the pidmap_lock is held as an
> * interrupt might come in and do read_lock(&tasklist_lock).
> --
> 1.7.7.6

2012-11-19 14:21:52

by Eric W. Biederman

[permalink] [raw]
Subject: Re: [PATCH] pidns: remove the useless function is_container_init

"Serge E. Hallyn" <[email protected]> writes:

> Quoting Gao feng ([email protected]):
>> since commit 1cdcbec1a3372c0c49c59d292e708fd07b509f18,
>> is_container_init has no used for a long time.
>>
>> just remove it.
>
> Only thing is it's being exported, so I think it needs to go through
> deprecation.

Exports do not create an ABI. No internal kernel users are enough.

Eric

2012-11-19 14:29:09

by Serge E. Hallyn

[permalink] [raw]
Subject: Re: [PATCH] pidns: remove the useless function is_container_init

Quoting Eric W. Biederman ([email protected]):
> "Serge E. Hallyn" <[email protected]> writes:
>
> > Quoting Gao feng ([email protected]):
> >> since commit 1cdcbec1a3372c0c49c59d292e708fd07b509f18,
> >> is_container_init has no used for a long time.
> >>
> >> just remove it.
> >
> > Only thing is it's being exported, so I think it needs to go through
> > deprecation.
>
> Exports do not create an ABI. No internal kernel users are enough.

Ok. I personally don't know of any out of tree users anyway, just seemed
like a warning for one cycle would be friendly :)

Acked-by: Serge Hallyn <[email protected]>

thanks,
-serge