diff options
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -60,7 +60,6 @@ static struct vm_operations_struct shm_vm_ops; | |||
60 | 60 | ||
61 | #define shm_unlock(shp) \ | 61 | #define shm_unlock(shp) \ |
62 | ipc_unlock(&(shp)->shm_perm) | 62 | ipc_unlock(&(shp)->shm_perm) |
63 | #define shm_buildid(id, seq) ipc_buildid(id, seq) | ||
64 | 63 | ||
65 | static int newseg(struct ipc_namespace *, struct ipc_params *); | 64 | static int newseg(struct ipc_namespace *, struct ipc_params *); |
66 | static void shm_open(struct vm_area_struct *vma); | 65 | static void shm_open(struct vm_area_struct *vma); |
@@ -169,12 +168,6 @@ static inline void shm_rmid(struct ipc_namespace *ns, struct shmid_kernel *s) | |||
169 | ipc_rmid(&shm_ids(ns), &s->shm_perm); | 168 | ipc_rmid(&shm_ids(ns), &s->shm_perm); |
170 | } | 169 | } |
171 | 170 | ||
172 | static inline int shm_addid(struct ipc_namespace *ns, struct shmid_kernel *shp) | ||
173 | { | ||
174 | return ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); | ||
175 | } | ||
176 | |||
177 | |||
178 | 171 | ||
179 | /* This is called by fork, once for every shm attach. */ | 172 | /* This is called by fork, once for every shm attach. */ |
180 | static void shm_open(struct vm_area_struct *vma) | 173 | static void shm_open(struct vm_area_struct *vma) |
@@ -416,7 +409,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
416 | if (IS_ERR(file)) | 409 | if (IS_ERR(file)) |
417 | goto no_file; | 410 | goto no_file; |
418 | 411 | ||
419 | id = shm_addid(ns, shp); | 412 | id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni); |
420 | if (id < 0) { | 413 | if (id < 0) { |
421 | error = id; | 414 | error = id; |
422 | goto no_id; | 415 | goto no_id; |
@@ -428,7 +421,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params) | |||
428 | shp->shm_ctim = get_seconds(); | 421 | shp->shm_ctim = get_seconds(); |
429 | shp->shm_segsz = size; | 422 | shp->shm_segsz = size; |
430 | shp->shm_nattch = 0; | 423 | shp->shm_nattch = 0; |
431 | shp->shm_perm.id = shm_buildid(id, shp->shm_perm.seq); | ||
432 | shp->shm_file = file; | 424 | shp->shm_file = file; |
433 | /* | 425 | /* |
434 | * shmid gets reported as "inode#" in /proc/pid/maps. | 426 | * shmid gets reported as "inode#" in /proc/pid/maps. |