--- zzzz-none-000/linux-3.10.107/include/linux/shm.h 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/include/linux/shm.h 2021-02-04 17:41:59.000000000 +0000 @@ -1,15 +1,15 @@ #ifndef _LINUX_SHM_H_ #define _LINUX_SHM_H_ +#include #include #include - -#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ #include + struct shmid_kernel /* private to the kernel */ { struct kern_ipc_perm shm_perm; - struct file * shm_file; + struct file *shm_file; unsigned long shm_nattch; unsigned long shm_segsz; time_t shm_atim; @@ -21,6 +21,7 @@ /* 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 */ }; /* shm_mode upper byte flags */ @@ -45,11 +46,20 @@ #define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT) #ifdef CONFIG_SYSVIPC +struct sysv_shm { + struct list_head shm_clist; +}; + long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, unsigned long shmlba); -extern int is_file_shm_hugepages(struct file *file); -extern void exit_shm(struct task_struct *task); +int is_file_shm_hugepages(struct file *file); +void exit_shm(struct task_struct *task); +#define shm_init_task(task) INIT_LIST_HEAD(&(task)->sysvshm.shm_clist) #else +struct sysv_shm { + /* empty */ +}; + static inline long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, unsigned long shmlba) @@ -63,6 +73,9 @@ static inline void exit_shm(struct task_struct *task) { } +static inline void shm_init_task(struct task_struct *task) +{ +} #endif #endif /* _LINUX_SHM_H_ */