diff options
Diffstat (limited to 'ipc/util.h')
-rw-r--r-- | ipc/util.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/ipc/util.h b/ipc/util.h index 76f8a79902de..99414a36a250 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -54,7 +54,7 @@ struct ipc_params { | |||
54 | * the calls to sys_msgget(), sys_semget(), sys_shmget() | 54 | * the calls to sys_msgget(), sys_semget(), sys_shmget() |
55 | * . routine to call to create a new ipc object. Can be one of newque, | 55 | * . routine to call to create a new ipc object. Can be one of newque, |
56 | * newary, newseg | 56 | * newary, newseg |
57 | * . routine to call to call to check permissions for a new ipc object. | 57 | * . routine to call to check permissions for a new ipc object. |
58 | * Can be one of security_msg_associate, security_sem_associate, | 58 | * Can be one of security_msg_associate, security_sem_associate, |
59 | * security_shm_associate | 59 | * security_shm_associate |
60 | * . routine to call for an extra check if needed | 60 | * . routine to call for an extra check if needed |
@@ -88,7 +88,8 @@ int ipc_get_maxid(struct ipc_ids *); | |||
88 | /* must be called with both locks acquired. */ | 88 | /* must be called with both locks acquired. */ |
89 | void ipc_rmid(struct ipc_ids *, struct kern_ipc_perm *); | 89 | void ipc_rmid(struct ipc_ids *, struct kern_ipc_perm *); |
90 | 90 | ||
91 | int ipcperms (struct kern_ipc_perm *ipcp, short flg); | 91 | /* must be called with ipcp locked */ |
92 | int ipcperms(struct kern_ipc_perm *ipcp, short flg); | ||
92 | 93 | ||
93 | /* for rare, potentially huge allocations. | 94 | /* for rare, potentially huge allocations. |
94 | * both function can sleep | 95 | * both function can sleep |
@@ -131,6 +132,9 @@ static inline int ipc_buildid(struct ipc_ids *ids, int id, int seq) | |||
131 | return SEQ_MULTIPLIER * seq + id; | 132 | return SEQ_MULTIPLIER * seq + id; |
132 | } | 133 | } |
133 | 134 | ||
135 | /* | ||
136 | * Must be called with ipcp locked | ||
137 | */ | ||
134 | static inline int ipc_checkid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp, | 138 | static inline int ipc_checkid(struct ipc_ids *ids, struct kern_ipc_perm *ipcp, |
135 | int uid) | 139 | int uid) |
136 | { | 140 | { |
@@ -168,6 +172,16 @@ static inline struct kern_ipc_perm *ipc_lock_check(struct ipc_ids *ids, | |||
168 | return out; | 172 | return out; |
169 | } | 173 | } |
170 | 174 | ||
175 | /** | ||
176 | * ipcget - Common sys_*get() code | ||
177 | * @ns : namsepace | ||
178 | * @ids : IPC identifier set | ||
179 | * @ops : operations to be called on ipc object creation, permission checks | ||
180 | * and further checks | ||
181 | * @params : the parameters needed by the previous operations. | ||
182 | * | ||
183 | * Common routine called by sys_msgget(), sys_semget() and sys_shmget(). | ||
184 | */ | ||
171 | static inline int ipcget(struct ipc_namespace *ns, struct ipc_ids *ids, | 185 | static inline int ipcget(struct ipc_namespace *ns, struct ipc_ids *ids, |
172 | struct ipc_ops *ops, struct ipc_params *params) | 186 | struct ipc_ops *ops, struct ipc_params *params) |
173 | { | 187 | { |