mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 01:23:00 -04:00
IPC: use ipc_buildid() directly from ipc_addid()
By continuing to consolidate a little the IPC code, each id can be built directly in ipc_addid() instead of having it built from each callers of ipc_addid() And I also remove shm_addid() in order to have, as much as possible, the same code for shm/sem/msg. [[email protected]: coding-style fixes] Signed-off-by: Pierre Peiffer <[email protected]> Cc: Nadia Derbey <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
02d15c4322
commit
48dea404ed
4 changed files with 2 additions and 13 deletions
10
ipc/shm.c
10
ipc/shm.c
|
|
@ -60,7 +60,6 @@ static struct vm_operations_struct shm_vm_ops;
|
|||
|
||||
#define shm_unlock(shp) \
|
||||
ipc_unlock(&(shp)->shm_perm)
|
||||
#define shm_buildid(id, seq) ipc_buildid(id, seq)
|
||||
|
||||
static int newseg(struct ipc_namespace *, struct ipc_params *);
|
||||
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)
|
|||
ipc_rmid(&shm_ids(ns), &s->shm_perm);
|
||||
}
|
||||
|
||||
static inline int shm_addid(struct ipc_namespace *ns, struct shmid_kernel *shp)
|
||||
{
|
||||
return ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* This is called by fork, once for every shm attach. */
|
||||
static void shm_open(struct vm_area_struct *vma)
|
||||
|
|
@ -416,7 +409,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
|
|||
if (IS_ERR(file))
|
||||
goto no_file;
|
||||
|
||||
id = shm_addid(ns, shp);
|
||||
id = ipc_addid(&shm_ids(ns), &shp->shm_perm, ns->shm_ctlmni);
|
||||
if (id < 0) {
|
||||
error = id;
|
||||
goto no_id;
|
||||
|
|
@ -428,7 +421,6 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
|
|||
shp->shm_ctim = get_seconds();
|
||||
shp->shm_segsz = size;
|
||||
shp->shm_nattch = 0;
|
||||
shp->shm_perm.id = shm_buildid(id, shp->shm_perm.seq);
|
||||
shp->shm_file = file;
|
||||
/*
|
||||
* shmid gets reported as "inode#" in /proc/pid/maps.
|
||||
|
|
|
|||
Loading…
Reference in a new issue