ipc: remove unneeded parameters
Remvoe the unneeded parameters from ipc_checkid() and ipc_buildid() interfaces. Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3e148c7993
commit
1b531f2136
@ -74,8 +74,7 @@ static struct ipc_ids init_msg_ids;
|
|||||||
#define msg_ids(ns) (*((ns)->ids[IPC_MSG_IDS]))
|
#define msg_ids(ns) (*((ns)->ids[IPC_MSG_IDS]))
|
||||||
|
|
||||||
#define msg_unlock(msq) ipc_unlock(&(msq)->q_perm)
|
#define msg_unlock(msq) ipc_unlock(&(msq)->q_perm)
|
||||||
#define msg_buildid(ns, id, seq) \
|
#define msg_buildid(id, seq) ipc_buildid(id, seq)
|
||||||
ipc_buildid(&msg_ids(ns), id, seq)
|
|
||||||
|
|
||||||
static void freeque(struct ipc_namespace *, struct msg_queue *);
|
static void freeque(struct ipc_namespace *, struct msg_queue *);
|
||||||
static int newque(struct ipc_namespace *, struct ipc_params *);
|
static int newque(struct ipc_namespace *, struct ipc_params *);
|
||||||
@ -211,7 +210,7 @@ static int newque(struct ipc_namespace *ns, struct ipc_params *params)
|
|||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
msq->q_perm.id = msg_buildid(ns, id, msq->q_perm.seq);
|
msq->q_perm.id = msg_buildid(id, msq->q_perm.seq);
|
||||||
msq->q_stime = msq->q_rtime = 0;
|
msq->q_stime = msq->q_rtime = 0;
|
||||||
msq->q_ctime = get_seconds();
|
msq->q_ctime = get_seconds();
|
||||||
msq->q_cbytes = msq->q_qnum = 0;
|
msq->q_cbytes = msq->q_qnum = 0;
|
||||||
|
10
ipc/sem.c
10
ipc/sem.c
@ -89,10 +89,8 @@
|
|||||||
#define sem_ids(ns) (*((ns)->ids[IPC_SEM_IDS]))
|
#define sem_ids(ns) (*((ns)->ids[IPC_SEM_IDS]))
|
||||||
|
|
||||||
#define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm)
|
#define sem_unlock(sma) ipc_unlock(&(sma)->sem_perm)
|
||||||
#define sem_checkid(ns, sma, semid) \
|
#define sem_checkid(sma, semid) ipc_checkid(&sma->sem_perm, semid)
|
||||||
ipc_checkid(&sem_ids(ns),&sma->sem_perm,semid)
|
#define sem_buildid(id, seq) ipc_buildid(id, seq)
|
||||||
#define sem_buildid(ns, id, seq) \
|
|
||||||
ipc_buildid(&sem_ids(ns), id, seq)
|
|
||||||
|
|
||||||
static struct ipc_ids init_sem_ids;
|
static struct ipc_ids init_sem_ids;
|
||||||
|
|
||||||
@ -292,7 +290,7 @@ static int newary(struct ipc_namespace *ns, struct ipc_params *params)
|
|||||||
}
|
}
|
||||||
ns->used_sems += nsems;
|
ns->used_sems += nsems;
|
||||||
|
|
||||||
sma->sem_perm.id = sem_buildid(ns, id, sma->sem_perm.seq);
|
sma->sem_perm.id = sem_buildid(id, sma->sem_perm.seq);
|
||||||
sma->sem_base = (struct sem *) &sma[1];
|
sma->sem_base = (struct sem *) &sma[1];
|
||||||
/* sma->sem_pending = NULL; */
|
/* sma->sem_pending = NULL; */
|
||||||
sma->sem_pending_last = &sma->sem_pending;
|
sma->sem_pending_last = &sma->sem_pending;
|
||||||
@ -1386,7 +1384,7 @@ void exit_sem(struct task_struct *tsk)
|
|||||||
if (u->semid == -1)
|
if (u->semid == -1)
|
||||||
goto next_entry;
|
goto next_entry;
|
||||||
|
|
||||||
BUG_ON(sem_checkid(ns,sma,u->semid));
|
BUG_ON(sem_checkid(sma, u->semid));
|
||||||
|
|
||||||
/* remove u from the sma->undo list */
|
/* remove u from the sma->undo list */
|
||||||
for (unp = &sma->undo; (un = *unp); unp = &un->id_next) {
|
for (unp = &sma->undo; (un = *unp); unp = &un->id_next) {
|
||||||
|
@ -61,8 +61,7 @@ static struct ipc_ids init_shm_ids;
|
|||||||
|
|
||||||
#define shm_unlock(shp) \
|
#define shm_unlock(shp) \
|
||||||
ipc_unlock(&(shp)->shm_perm)
|
ipc_unlock(&(shp)->shm_perm)
|
||||||
#define shm_buildid(ns, id, seq) \
|
#define shm_buildid(id, seq) ipc_buildid(id, seq)
|
||||||
ipc_buildid(&shm_ids(ns), id, seq)
|
|
||||||
|
|
||||||
static int newseg(struct ipc_namespace *, struct ipc_params *);
|
static int newseg(struct ipc_namespace *, struct ipc_params *);
|
||||||
static void shm_open(struct vm_area_struct *vma);
|
static void shm_open(struct vm_area_struct *vma);
|
||||||
@ -445,7 +444,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
|
|||||||
shp->shm_ctim = get_seconds();
|
shp->shm_ctim = get_seconds();
|
||||||
shp->shm_segsz = size;
|
shp->shm_segsz = size;
|
||||||
shp->shm_nattch = 0;
|
shp->shm_nattch = 0;
|
||||||
shp->shm_perm.id = shm_buildid(ns, id, shp->shm_perm.seq);
|
shp->shm_perm.id = shm_buildid(id, shp->shm_perm.seq);
|
||||||
shp->shm_file = file;
|
shp->shm_file = file;
|
||||||
/*
|
/*
|
||||||
* shmid gets reported as "inode#" in /proc/pid/maps.
|
* shmid gets reported as "inode#" in /proc/pid/maps.
|
||||||
|
@ -134,7 +134,7 @@ extern int ipcget_new(struct ipc_namespace *, struct ipc_ids *,
|
|||||||
extern int ipcget_public(struct ipc_namespace *, struct ipc_ids *,
|
extern int ipcget_public(struct ipc_namespace *, struct ipc_ids *,
|
||||||
struct ipc_ops *, struct ipc_params *);
|
struct ipc_ops *, struct ipc_params *);
|
||||||
|
|
||||||
static inline int ipc_buildid(struct ipc_ids *ids, int id, int seq)
|
static inline int ipc_buildid(int id, int seq)
|
||||||
{
|
{
|
||||||
return SEQ_MULTIPLIER * seq + id;
|
return SEQ_MULTIPLIER * seq + id;
|
||||||
}
|
}
|
||||||
@ -142,8 +142,7 @@ static inline int ipc_buildid(struct ipc_ids *ids, int id, int seq)
|
|||||||
/*
|
/*
|
||||||
* Must be called with ipcp locked
|
* Must be called with ipcp locked
|
||||||
*/
|
*/
|
||||||
static inline int ipc_checkid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp,
|
static inline int ipc_checkid(struct kern_ipc_perm *ipcp, int uid)
|
||||||
int uid)
|
|
||||||
{
|
{
|
||||||
if (uid / SEQ_MULTIPLIER != ipcp->seq)
|
if (uid / SEQ_MULTIPLIER != ipcp->seq)
|
||||||
return 1;
|
return 1;
|
||||||
@ -171,7 +170,7 @@ static inline struct kern_ipc_perm *ipc_lock_check_down(struct ipc_ids *ids,
|
|||||||
if (IS_ERR(out))
|
if (IS_ERR(out))
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
if (ipc_checkid(ids, out, id)) {
|
if (ipc_checkid(out, id)) {
|
||||||
ipc_unlock(out);
|
ipc_unlock(out);
|
||||||
return ERR_PTR(-EIDRM);
|
return ERR_PTR(-EIDRM);
|
||||||
}
|
}
|
||||||
@ -188,7 +187,7 @@ static inline struct kern_ipc_perm *ipc_lock_check(struct ipc_ids *ids,
|
|||||||
if (IS_ERR(out))
|
if (IS_ERR(out))
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
if (ipc_checkid(ids, out, id)) {
|
if (ipc_checkid(out, id)) {
|
||||||
ipc_unlock(out);
|
ipc_unlock(out);
|
||||||
return ERR_PTR(-EIDRM);
|
return ERR_PTR(-EIDRM);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user