ipc: introduce the ipcid_to_idx macro
[linux-2.6-block.git] / ipc / util.h
index 2a03d8cc6a01423bbb1cb9ce9289d79c3afa8cae..fa7e7a07486eb21f0051c2cb854546ccd2c16559 100644 (file)
@@ -79,6 +79,8 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
 #define IPC_MSG_IDS    1
 #define IPC_SHM_IDS    2
 
+#define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
+
 /* must be called with ids->mutex acquired.*/
 int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);
 int ipc_get_maxid(struct ipc_ids *);