Skip to content

Commit a5ba911

Browse files
Gao fengtorvalds
authored andcommitted
pidns: remove unused is_container_init()
Since commit 1cdcbec ("CRED: Neuter sys_capset()") is_container_init() has no callers. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com> Cc: David Howells <dhowells@redhat.com> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Cc: James Morris <jmorris@namei.org> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent d740269 commit a5ba911

2 files changed

Lines changed: 0 additions & 21 deletions

File tree

‎include/linux/sched.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,12 +1778,6 @@ static inline int is_global_init(struct task_struct *tsk)
17781778
return tsk->pid == 1;
17791779
}
17801780

1781-
/*
1782-
* is_container_init:
1783-
* check whether in the task is init in its own pid namespace.
1784-
*/
1785-
extern int is_container_init(struct task_struct *tsk);
1786-
17871781
extern struct pid *cad_pid;
17881782

17891783
extern void free_task(struct task_struct *tsk);

‎kernel/pid.c‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,6 @@ struct pid_namespace init_pid_ns = {
8181
};
8282
EXPORT_SYMBOL_GPL(init_pid_ns);
8383

84-
int is_container_init(struct task_struct *tsk)
85-
{
86-
int ret = 0;
87-
struct pid *pid;
88-
89-
rcu_read_lock();
90-
pid = task_pid(tsk);
91-
if (pid != NULL && pid->numbers[pid->level].nr == 1)
92-
ret = 1;
93-
rcu_read_unlock();
94-
95-
return ret;
96-
}
97-
EXPORT_SYMBOL(is_container_init);
98-
9984
/*
10085
* Note: disable interrupts while the pidmap_lock is held as an
10186
* interrupt might come in and do read_lock(&tasklist_lock).

0 commit comments

Comments
 (0)