From: Andrew Morton Unobfsucate this struct member Cc: Manfred Spraul Signed-off-by: Andrew Morton --- ipc/shm.c | 22 ++++++++++------------ 1 files changed, 10 insertions(+), 12 deletions(-) diff -puN ipc/shm.c~ipc-expand-shm_flags ipc/shm.c --- devel/ipc/shm.c~ipc-expand-shm_flags 2005-11-09 22:23:16.000000000 -0800 +++ devel-akpm/ipc/shm.c 2005-11-09 22:23:16.000000000 -0800 @@ -34,8 +34,6 @@ #include "util.h" -#define shm_flags shm_perm.mode - static struct file_operations shm_file_operations; static struct vm_operations_struct shm_vm_ops; @@ -148,7 +146,7 @@ static void shm_close (struct vm_area_st shp->shm_dtim = get_seconds(); shp->shm_nattch--; if(shp->shm_nattch == 0 && - shp->shm_flags & SHM_DEST) + shp->shm_perm.mode & SHM_DEST) shm_destroy (shp); else shm_unlock(shp); @@ -197,7 +195,7 @@ static int newseg (key_t key, int shmflg return -ENOMEM; shp->shm_perm.key = key; - shp->shm_flags = (shmflg & S_IRWXUGO); + shp->shm_perm.mode = (shmflg & S_IRWXUGO); shp->mlock_user = NULL; shp->shm_perm.security = NULL; @@ -337,7 +335,7 @@ static inline unsigned long copy_shmid_f out->uid = tbuf.shm_perm.uid; out->gid = tbuf.shm_perm.gid; - out->mode = tbuf.shm_flags; + out->mode = tbuf.shm_perm.mode; return 0; } @@ -350,7 +348,7 @@ static inline unsigned long copy_shmid_f out->uid = tbuf_old.shm_perm.uid; out->gid = tbuf_old.shm_perm.gid; - out->mode = tbuf_old.shm_flags; + out->mode = tbuf_old.shm_perm.mode; return 0; } @@ -552,13 +550,13 @@ asmlinkage long sys_shmctl (int shmid, i if (!is_file_hugepages(shp->shm_file)) { err = shmem_lock(shp->shm_file, 1, user); if (!err) { - shp->shm_flags |= SHM_LOCKED; + shp->shm_perm.mode |= SHM_LOCKED; shp->mlock_user = user; } } } else if (!is_file_hugepages(shp->shm_file)) { shmem_lock(shp->shm_file, 0, shp->mlock_user); - shp->shm_flags &= ~SHM_LOCKED; + shp->shm_perm.mode &= ~SHM_LOCKED; shp->mlock_user = NULL; } shm_unlock(shp); @@ -597,7 +595,7 @@ asmlinkage long sys_shmctl (int shmid, i goto out_unlock_up; if (shp->shm_nattch){ - shp->shm_flags |= SHM_DEST; + shp->shm_perm.mode |= SHM_DEST; /* Do not find it any more */ shp->shm_perm.key = IPC_PRIVATE; shm_unlock(shp); @@ -636,7 +634,7 @@ asmlinkage long sys_shmctl (int shmid, i shp->shm_perm.uid = setbuf.uid; shp->shm_perm.gid = setbuf.gid; - shp->shm_flags = (shp->shm_flags & ~S_IRWXUGO) + shp->shm_perm.mode = (shp->shm_perm.mode & ~S_IRWXUGO) | (setbuf.mode & S_IRWXUGO); shp->shm_ctim = get_seconds(); break; @@ -769,7 +767,7 @@ invalid: BUG(); shp->shm_nattch--; if(shp->shm_nattch == 0 && - shp->shm_flags & SHM_DEST) + shp->shm_perm.mode & SHM_DEST) shm_destroy (shp); else shm_unlock(shp); @@ -894,7 +892,7 @@ static int sysvipc_shm_proc_show(struct return seq_printf(s, format, shp->shm_perm.key, shp->id, - shp->shm_flags, + shp->shm_perm.mode, shp->shm_segsz, shp->shm_cprid, shp->shm_lprid, _