Skip to content

Commit a2e102c

Browse files
committed
shm: Move struct shmid_kernel into ipc/shm.c
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" <[email protected]>
1 parent 1a5c134 commit a2e102c

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

include/linux/shm.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,6 @@
77
#include <uapi/linux/shm.h>
88
#include <asm/shmparam.h>
99

10-
struct shmid_kernel /* private to the kernel */
11-
{
12-
struct kern_ipc_perm shm_perm;
13-
struct file *shm_file;
14-
unsigned long shm_nattch;
15-
unsigned long shm_segsz;
16-
time64_t shm_atim;
17-
time64_t shm_dtim;
18-
time64_t shm_ctim;
19-
pid_t shm_cprid;
20-
pid_t shm_lprid;
21-
struct user_struct *mlock_user;
22-
23-
/* The task created the shm object. NULL if the task is dead. */
24-
struct task_struct *shm_creator;
25-
struct list_head shm_clist; /* list by creator */
26-
} __randomize_layout;
27-
28-
/* shm_mode upper byte flags */
29-
#define SHM_DEST 01000 /* segment will be destroyed on last detach */
30-
#define SHM_LOCKED 02000 /* segment will not be swapped */
31-
3210
#ifdef CONFIG_SYSVIPC
3311
struct sysv_shm {
3412
struct list_head shm_clist;

ipc/shm.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@
4848

4949
#include "util.h"
5050

51+
struct shmid_kernel /* private to the kernel */
52+
{
53+
struct kern_ipc_perm shm_perm;
54+
struct file *shm_file;
55+
unsigned long shm_nattch;
56+
unsigned long shm_segsz;
57+
time64_t shm_atim;
58+
time64_t shm_dtim;
59+
time64_t shm_ctim;
60+
pid_t shm_cprid;
61+
pid_t shm_lprid;
62+
struct user_struct *mlock_user;
63+
64+
/* The task created the shm object. NULL if the task is dead. */
65+
struct task_struct *shm_creator;
66+
struct list_head shm_clist; /* list by creator */
67+
} __randomize_layout;
68+
69+
/* shm_mode upper byte flags */
70+
#define SHM_DEST 01000 /* segment will be destroyed on last detach */
71+
#define SHM_LOCKED 02000 /* segment will not be swapped */
72+
5173
struct shm_file_data {
5274
int id;
5375
struct ipc_namespace *ns;

0 commit comments

Comments
 (0)