Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp7104759rdb; Fri, 15 Dec 2023 19:31:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZ6OU3DeeOlVvKzev15FVTVbCGP2UBe5IJLVz2ASxQM1ADMuMBfTnMFG1SKL0UyNC4KX3C X-Received: by 2002:a05:6e02:20e3:b0:35f:8263:878b with SMTP id q3-20020a056e0220e300b0035f8263878bmr5191946ilv.2.1702697464579; Fri, 15 Dec 2023 19:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702697464; cv=none; d=google.com; s=arc-20160816; b=HWvtTygzH2O7yU4KQs8g4AV7NEESgFjtOyQ/YMOuIQq/xl29ttNT/SOMb21o4Uqrpw ivyySE60Hlby29OoI3yuqpUwSwBsFvzLBEBEPqJCTj9UctC/aAZhIDyxM8JmtIGBMM3b ahxOcXFg1SfCgbwIpmqt3UPqehnfYOn1ElCRMc3b0BbivPEmatobg8KjMsZVCipZF+SZ bLtL5VaBShlwZwKbwmqzjRRaZ7NexOS4oTl5ScO1E0OwVdMTCphoAJfTQJ7A4vxEFz8f 2O9qhoRuWffuXDP9Pyw+B76/LoPXqZ1MJSrpyJM18aU/Mm9OW+x1KSwM+wZIFrS/dpZ7 x30g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ocPDVHoS7vEhw6tr2I6a+vqz6+CvzqYlQOZuWmaACjs=; fh=kVeC8csnnfNlBPSkJ6lZkeTw2oqL3mSVlIIfxwC6HTE=; b=yNjtogpaqMHEGqTsVJJAwaMoYk+fCba4AWH0MhHh8wV1DbCeJytk1rugs6IlwBRY49 YITATnQgk78z4zMvQOmuStx89MJ7Kqv06OMYOm+kZ1afOjbrrEEql9eMH6W4qs9fmC5t PNzylJZzD7UsosCRJe7VLP+4CUAbicOalr9KoSJ680Z0/BBbxHh5ADHa+c16+V/yB1yW mqYsjZAkjQ+rzRh/q1Q/odlxNq3YqgyTZAKIHYPG9qbOU6yhkrq7qWZbUjZZzXkws3OY k1CAoU71Wt31j5RIgC+dBwDW00fcukNE3fTx9Vn5NLG6n81avcRW2vX/A/Rxc/1LGqrK BjLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=MFvpTzAH; spf=pass (google.com: domain of linux-kernel+bounces-2000-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h9-20020a170902b94900b001cfd754d79esi14189377pls.79.2023.12.15.19.31.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Dec 2023 19:31:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2000-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=MFvpTzAH; spf=pass (google.com: domain of linux-kernel+bounces-2000-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2000-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 31EB62842D3 for ; Sat, 16 Dec 2023 03:31:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D768E10953; Sat, 16 Dec 2023 03:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="MFvpTzAH" X-Original-To: linux-kernel@vger.kernel.org Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDD48101F5 for ; Sat, 16 Dec 2023 03:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1702697406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ocPDVHoS7vEhw6tr2I6a+vqz6+CvzqYlQOZuWmaACjs=; b=MFvpTzAHZrRy1GsWJgEbV5sUn3JBdOzPITqjc+x2YXTYOyRxMDxGyb0QcQlfWXCByyKVKk G0ZLeiQmLO2bKrCM457BFrpTL8dvQbBS8Dszx5Keykadem6YhSAfF3z/4a52vJrcMYILTh b/dEnYVIXWAmR5h3vpZWXvEStueaZm0= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Cc: Kent Overstreet , tglx@linutronix.de, x86@kernel.org, tj@kernel.org, peterz@infradead.org, mathieu.desnoyers@efficios.com, paulmck@kernel.org, keescook@chromium.org, dave.hansen@linux.intel.com, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, brauner@kernel.org, Andy Lutomirski , Will Drewry Subject: [PATCH 22/50] pid: Split out pid_types.h Date: Fri, 15 Dec 2023 22:29:28 -0500 Message-ID: <20231216032957.3553313-1-kent.overstreet@linux.dev> In-Reply-To: <20231216024834.3510073-1-kent.overstreet@linux.dev> References: <20231216024834.3510073-1-kent.overstreet@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Trimming down sched.h dependencies: we dont't want to include more than the base types. Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Signed-off-by: Kent Overstreet --- drivers/target/target_core_xcopy.c | 1 + include/linux/pid.h | 15 ++------------- include/linux/pid_types.h | 16 ++++++++++++++++ include/linux/sched.h | 2 +- include/linux/seccomp.h | 2 ++ 5 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 include/linux/pid_types.h diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 91ed015b588c..4128631c9dfd 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/include/linux/pid.h b/include/linux/pid.h index 653a527574c4..f254c3a45b9b 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -2,18 +2,10 @@ #ifndef _LINUX_PID_H #define _LINUX_PID_H +#include #include -#include #include - -enum pid_type -{ - PIDTYPE_PID, - PIDTYPE_TGID, - PIDTYPE_PGID, - PIDTYPE_SID, - PIDTYPE_MAX, -}; +#include /* * What is struct pid? @@ -110,9 +102,6 @@ extern void exchange_tids(struct task_struct *task, struct task_struct *old); extern void transfer_pid(struct task_struct *old, struct task_struct *new, enum pid_type); -struct pid_namespace; -extern struct pid_namespace init_pid_ns; - extern int pid_max; extern int pid_max_min, pid_max_max; diff --git a/include/linux/pid_types.h b/include/linux/pid_types.h new file mode 100644 index 000000000000..c2aee1d91dcf --- /dev/null +++ b/include/linux/pid_types.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _LINUX_PID_TYPES_H +#define _LINUX_PID_TYPES_H + +enum pid_type { + PIDTYPE_PID, + PIDTYPE_TGID, + PIDTYPE_PGID, + PIDTYPE_SID, + PIDTYPE_MAX, +}; + +struct pid_namespace; +extern struct pid_namespace init_pid_ns; + +#endif /* _LINUX_PID_TYPES_H */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 436f7ce1450a..37cc9d257073 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -11,7 +11,7 @@ #include -#include +#include #include #include #include diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h index 175079552f68..1ec0d8dc4b69 100644 --- a/include/linux/seccomp.h +++ b/include/linux/seccomp.h @@ -126,6 +126,8 @@ static inline long seccomp_get_metadata(struct task_struct *task, #ifdef CONFIG_SECCOMP_CACHE_DEBUG struct seq_file; +struct pid_namespace; +struct pid; int proc_pid_seccomp_cache(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task); -- 2.43.0