From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B87BCC5CFE7 for ; Wed, 11 Jul 2018 02:46:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D051208EB for ; Wed, 11 Jul 2018 02:46:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D051208EB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xmission.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732489AbeGKCsM (ORCPT ); Tue, 10 Jul 2018 22:48:12 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:40129 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732292AbeGKCsM (ORCPT ); Tue, 10 Jul 2018 22:48:12 -0400 Received: from in01.mta.xmission.com ([166.70.13.51]) by out01.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fd58s-00012G-QQ; Tue, 10 Jul 2018 20:46:10 -0600 Received: from [97.119.167.31] (helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fd58q-00063R-Ti; Tue, 10 Jul 2018 20:46:10 -0600 From: "Eric W. Biederman" To: Linus Torvalds Cc: Oleg Nesterov , Andrew Morton , linux-kernel@vger.kernel.org, Wen Yang , majiang , "Eric W. Biederman" Date: Tue, 10 Jul 2018 21:44:50 -0500 Message-Id: <20180711024459.10654-2-ebiederm@xmission.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <877em2jxyr.fsf_-_@xmission.com> References: <877em2jxyr.fsf_-_@xmission.com> X-XM-SPF: eid=1fd58q-00063R-Ti;;;mid=<20180711024459.10654-2-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+I9NRzQpd8Yaum9ZpPzKdh83HQoh/u0P0= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [RFC][PATCH 02/11] pids: Move task_pid_type into sched/signal.h X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function is general and inline so there is no need to hide it inside of exit.c Signed-off-by: "Eric W. Biederman" --- include/linux/sched/signal.h | 8 ++++++++ kernel/exit.c | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/linux/sched/signal.h b/include/linux/sched/signal.h index 113d1ad1ced7..d8ef0a3d2e7e 100644 --- a/include/linux/sched/signal.h +++ b/include/linux/sched/signal.h @@ -556,6 +556,14 @@ extern bool current_is_single_threaded(void); typedef int (*proc_visitor)(struct task_struct *p, void *data); void walk_process_tree(struct task_struct *top, proc_visitor, void *); +static inline +struct pid *task_pid_type(struct task_struct *task, enum pid_type type) +{ + if (type != PIDTYPE_PID) + task = task->group_leader; + return task->pids[type].pid; +} + static inline int get_nr_threads(struct task_struct *tsk) { return tsk->signal->nr_threads; diff --git a/kernel/exit.c b/kernel/exit.c index c3c7ac560114..16432428fc6c 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -1001,14 +1001,6 @@ struct wait_opts { int notask_error; }; -static inline -struct pid *task_pid_type(struct task_struct *task, enum pid_type type) -{ - if (type != PIDTYPE_PID) - task = task->group_leader; - return task->pids[type].pid; -} - static int eligible_pid(struct wait_opts *wo, struct task_struct *p) { return wo->wo_type == PIDTYPE_MAX || -- 2.17.1