ipc: delete seq_max field in struct ipc_ids
[linux.git] / ipc / util.h
index d64db3e56f7d0457488489be7acf13f430229ccd..9c47d6f6c7b4b6c63b05b8a7c246ea3efcdeb0dc 100644 (file)
@@ -100,6 +100,7 @@ void __init ipc_init_proc_interface(const char *path, const char *header,
 
 #define ipcid_to_idx(id) ((id) % SEQ_MULTIPLIER)
 #define ipcid_to_seqx(id) ((id) / SEQ_MULTIPLIER)
+#define IPCID_SEQ_MAX min_t(int, INT_MAX/SEQ_MULTIPLIER, USHRT_MAX)
 
 /* must be called with ids->rwsem acquired for writing */
 int ipc_addid(struct ipc_ids *, struct kern_ipc_perm *, int);