Skip to content

Commit 6d5e9d6

Browse files
author
Kent Overstreet
committed
pid: Split out pid_types.h
Trimming down sched.h dependencies: we dont't want to include more than the base types. Cc: Kees Cook <keescook@chromium.org> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Will Drewry <wad@chromium.org> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent f038cc1 commit 6d5e9d6

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

drivers/target/target_core_xcopy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/slab.h>
1616
#include <linux/spinlock.h>
1717
#include <linux/list.h>
18+
#include <linux/rculist.h>
1819
#include <linux/configfs.h>
1920
#include <linux/ratelimit.h>
2021
#include <scsi/scsi_proto.h>

include/linux/pid.h

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@
22
#ifndef _LINUX_PID_H
33
#define _LINUX_PID_H
44

5+
#include <linux/pid_types.h>
56
#include <linux/rculist.h>
6-
#include <linux/wait.h>
77
#include <linux/refcount.h>
8-
9-
enum pid_type
10-
{
11-
PIDTYPE_PID,
12-
PIDTYPE_TGID,
13-
PIDTYPE_PGID,
14-
PIDTYPE_SID,
15-
PIDTYPE_MAX,
16-
};
8+
#include <linux/wait.h>
179

1810
/*
1911
* What is struct pid?
@@ -110,9 +102,6 @@ extern void exchange_tids(struct task_struct *task, struct task_struct *old);
110102
extern void transfer_pid(struct task_struct *old, struct task_struct *new,
111103
enum pid_type);
112104

113-
struct pid_namespace;
114-
extern struct pid_namespace init_pid_ns;
115-
116105
extern int pid_max;
117106
extern int pid_max_min, pid_max_max;
118107

include/linux/pid_types.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _LINUX_PID_TYPES_H
3+
#define _LINUX_PID_TYPES_H
4+
5+
enum pid_type {
6+
PIDTYPE_PID,
7+
PIDTYPE_TGID,
8+
PIDTYPE_PGID,
9+
PIDTYPE_SID,
10+
PIDTYPE_MAX,
11+
};
12+
13+
struct pid_namespace;
14+
extern struct pid_namespace init_pid_ns;
15+
16+
#endif /* _LINUX_PID_TYPES_H */

include/linux/sched.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <asm/current.h>
1313

14-
#include <linux/pid.h>
14+
#include <linux/pid_types.h>
1515
#include <linux/sem.h>
1616
#include <linux/shm.h>
1717
#include <linux/kmsan_types.h>

include/linux/seccomp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ static inline long seccomp_get_metadata(struct task_struct *task,
126126

127127
#ifdef CONFIG_SECCOMP_CACHE_DEBUG
128128
struct seq_file;
129+
struct pid_namespace;
130+
struct pid;
129131

130132
int proc_pid_seccomp_cache(struct seq_file *m, struct pid_namespace *ns,
131133
struct pid *pid, struct task_struct *task);

0 commit comments

Comments
 (0)