Received: by 10.213.65.68 with SMTP id h4csp642765imn; Fri, 23 Mar 2018 12:20:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELurGY3jloL2OmQFmx0SbayneACnzAC1Jb8CFOtmrsDg6ywpPYh1tnFAwjXyyXjQ5uO8UUnp X-Received: by 2002:a17:902:bd05:: with SMTP id p5-v6mr30574278pls.137.1521832845249; Fri, 23 Mar 2018 12:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521832845; cv=none; d=google.com; s=arc-20160816; b=bZ6b8fXdJzFkV5A3OrzQ7xvXGHrqBVeHN1gvxMQFeLKK2WqdDP1wRARZhngJNWLM2G v8I9bpg/FF7SzcJ+53YFPJtVJ8Axqnu5Sc+ijYoAWhRhvX4JqV6BkbBRhjIkosi4Eu/b ETJnAQni7rkY/8Hl9pBwgXcGhnwgqPmT8MKCFB24QNvogeJVQ8sWherKfKXFpFl45Eri 8BrCHUYNHXJA52BpZevfRH09EA9kpfu275kP8lVLh5iQ93ePYeRP62Dp7YwchWLLsu8k l4z/qjjPJIsKU68zdC8ADIhKkjXVBC2PUrmmDSfffPMP/Va3TDLl6R++txw+qopMKGxM gCkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=C99s/HYOgtK91zcVSl6aVf7Q5coBKHK7Ulbfp+82A+A=; b=yJIAaIJYZ6G85iYL6v5By3lffzEif3A8DpiKKrsmt6nphMZ0YKlEdgak2+cpKqV+5v m04Zw12RdsevfPwzCa6AFYR0aAHCmpolstGzTd76moE1kWKYUgFtgBOzBM+9caPSwiaZ HX1N2UU5nUFFOY6BpCQlhhovuYbXJ3DU2+wvorMAY4/q8skgCuEyHAVZTqXiDZRISFqv tq0jHu9RXMcdqJk+bXYhtrX5MY0OLluHKUXzeQgtUdHpj/G0Yhc3bvx15gMD5Aal9RIC 7J0aCU6AKiKUeHn1YkKwrg33GhzYmXhyi/w7ou8V7G5+pTEPBl6w9OORhbJ+3UCHa8Xm YbFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si5683890pls.368.2018.03.23.12.20.31; Fri, 23 Mar 2018 12:20:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbeCWTSH (ORCPT + 99 others); Fri, 23 Mar 2018 15:18:07 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:44648 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752527AbeCWTSC (ORCPT ); Fri, 23 Mar 2018 15:18:02 -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 1ezSCP-00075O-3Q; Fri, 23 Mar 2018 13:18:01 -0600 Received: from 97-119-121-173.omah.qwest.net ([97.119.121.173] 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 1ezSCN-00033I-FQ; Fri, 23 Mar 2018 13:18:00 -0600 From: "Eric W. Biederman" To: Linux Containers Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, khlebnikov@yandex-team.ru, prakash.sangappa@oracle.com, luto@kernel.org, akpm@linux-foundation.org, oleg@redhat.com, serge.hallyn@ubuntu.com, esyr@redhat.com, jannh@google.com, linux-security-module@vger.kernel.org, Pavel Emelyanov , Nagarathnam Muthusamy , "Eric W. Biederman" Date: Fri, 23 Mar 2018 14:16:08 -0500 Message-Id: <20180323191614.32489-5-ebiederm@xmission.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <87vadmobdw.fsf_-_@xmission.com> References: <87vadmobdw.fsf_-_@xmission.com> X-XM-SPF: eid=1ezSCN-00033I-FQ;;;mid=<20180323191614.32489-5-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.121.173;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+FF/1b+tb6ZT8A9rwzMryYeKLSzo2qChM= X-SA-Exim-Connect-IP: 97.119.121.173 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa05.xmission.com X-Spam-Level: **** X-Spam-Status: No, score=4.5 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,TR_Symld_Words,TVD_RCVD_IP,T_TooManySym_01,T_TooManySym_02, T_XMDrugObfuBody_04,XMNoVowels,XMSubLong autolearn=disabled version=3.4.1 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.5 TR_Symld_Words too many words that have symbols inside * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * 1.0 T_XMDrugObfuBody_04 obfuscated drug references X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ****;Linux Containers X-Spam-Relay-Country: X-Spam-Timing: total 274 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.1 (1.1%), b_tie_ro: 2.1 (0.7%), parse: 1.26 (0.5%), extract_message_metadata: 16 (6.0%), get_uri_detail_list: 2.3 (0.8%), tests_pri_-1000: 9 (3.2%), tests_pri_-950: 1.70 (0.6%), tests_pri_-900: 1.38 (0.5%), tests_pri_-400: 24 (8.9%), check_bayes: 23 (8.4%), b_tokenize: 10 (3.7%), b_tok_get_all: 6 (2.2%), b_comp_prob: 2.3 (0.8%), b_tok_touch_all: 2.6 (1.0%), b_finish: 0.71 (0.3%), tests_pri_0: 206 (75.0%), check_dkim_signature: 0.60 (0.2%), check_dkim_adsp: 2.8 (1.0%), tests_pri_500: 7 (2.7%), rewrite_mail: 0.00 (0.0%) Subject: [REVIEW][PATCH 05/11] shm: Move struct shmid_kernel into ipc/shm.c X-Spam-Flag: No 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 All of the users are now in ipc/shm.c so make the definition local to that file to make code maintenance easier. AKA to prevent rebuilding the entire kernel when struct shmid_kernel changes. Signed-off-by: "Eric W. Biederman" --- include/linux/shm.h | 23 ----------------------- ipc/shm.c | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/include/linux/shm.h b/include/linux/shm.h index 2bbafacfbfc9..c7cb18405ad7 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h @@ -3,32 +3,9 @@ #define _LINUX_SHM_H_ #include -#include #include #include -struct shmid_kernel /* private to the kernel */ -{ - struct kern_ipc_perm shm_perm; - struct file *shm_file; - unsigned long shm_nattch; - unsigned long shm_segsz; - time64_t shm_atim; - time64_t shm_dtim; - time64_t shm_ctim; - pid_t shm_cprid; - pid_t shm_lprid; - struct user_struct *mlock_user; - - /* The task created the shm object. NULL if the task is dead. */ - struct task_struct *shm_creator; - struct list_head shm_clist; /* list by creator */ -} __randomize_layout; - -/* shm_mode upper byte flags */ -#define SHM_DEST 01000 /* segment will be destroyed on last detach */ -#define SHM_LOCKED 02000 /* segment will not be swapped */ - #ifdef CONFIG_SYSVIPC struct sysv_shm { struct list_head shm_clist; diff --git a/ipc/shm.c b/ipc/shm.c index 387a786e7be1..0565669ebe5c 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -48,6 +48,28 @@ #include "util.h" +struct shmid_kernel /* private to the kernel */ +{ + struct kern_ipc_perm shm_perm; + struct file *shm_file; + unsigned long shm_nattch; + unsigned long shm_segsz; + time64_t shm_atim; + time64_t shm_dtim; + time64_t shm_ctim; + pid_t shm_cprid; + pid_t shm_lprid; + struct user_struct *mlock_user; + + /* The task created the shm object. NULL if the task is dead. */ + struct task_struct *shm_creator; + struct list_head shm_clist; /* list by creator */ +} __randomize_layout; + +/* shm_mode upper byte flags */ +#define SHM_DEST 01000 /* segment will be destroyed on last detach */ +#define SHM_LOCKED 02000 /* segment will not be swapped */ + struct shm_file_data { int id; struct ipc_namespace *ns; -- 2.14.1