aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.c
diff options
context:
space:
mode:
authorNadia Derbey <Nadia.Derbey@bull.net>2007-10-19 02:40:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 14:53:46 -0400
commitce621f5ba52f30dd59aef4fb50276faee04ef9cf (patch)
treee0260364cf8748849d37165760db6d4e4e51ed9c /ipc/util.c
parent03f02c7657f7948ab980280c54c9366f962b1474 (diff)
ipc: introduce the ipcid_to_idx macro
This is a trivial patch that changes all the (id % SEQ_MULTIPLIER) into a call to the ipcid_to_idx(id) macro. 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>
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipc/util.c b/ipc/util.c
index 9b0c4e7753af..c51c96f2e0cf 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -413,7 +413,7 @@ int ipcget_public(struct ipc_namespace *ns, struct ipc_ids *ids,
413 413
414void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp) 414void ipc_rmid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp)
415{ 415{
416 int lid = ipcp->id % SEQ_MULTIPLIER; 416 int lid = ipcid_to_idx(ipcp->id);
417 417
418 idr_remove(&ids->ipcs_idr, lid); 418 idr_remove(&ids->ipcs_idr, lid);
419 419
@@ -672,7 +672,7 @@ void ipc64_perm_to_ipc_perm (struct ipc64_perm *in, struct ipc_perm *out)
672struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id) 672struct kern_ipc_perm *ipc_lock(struct ipc_ids *ids, int id)
673{ 673{
674 struct kern_ipc_perm *out; 674 struct kern_ipc_perm *out;
675 int lid = id % SEQ_MULTIPLIER; 675 int lid = ipcid_to_idx(id);
676 676
677 rcu_read_lock(); 677 rcu_read_lock();
678 out = idr_find(&ids->ipcs_idr, lid); 678 out = idr_find(&ids->ipcs_idr, lid);