diff options
Diffstat (limited to 'ipc/msg.c')
-rw-r--r-- | ipc/msg.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -156,6 +156,13 @@ static inline void msg_rmid(struct ipc_namespace *ns, struct msg_queue *s) | |||
156 | ipc_rmid(&msg_ids(ns), &s->q_perm); | 156 | ipc_rmid(&msg_ids(ns), &s->q_perm); |
157 | } | 157 | } |
158 | 158 | ||
159 | /** | ||
160 | * newque - Create a new msg queue | ||
161 | * @ns: namespace | ||
162 | * @params: ptr to the structure that contains the key and msgflg | ||
163 | * | ||
164 | * Called with msg_ids.mutex held | ||
165 | */ | ||
159 | static int newque(struct ipc_namespace *ns, struct ipc_params *params) | 166 | static int newque(struct ipc_namespace *ns, struct ipc_params *params) |
160 | { | 167 | { |
161 | struct msg_queue *msq; | 168 | struct msg_queue *msq; |
@@ -250,8 +257,8 @@ static void expunge_all(struct msg_queue *msq, int res) | |||
250 | 257 | ||
251 | /* | 258 | /* |
252 | * freeque() wakes up waiters on the sender and receiver waiting queue, | 259 | * freeque() wakes up waiters on the sender and receiver waiting queue, |
253 | * removes the message queue from message queue ID | 260 | * removes the message queue from message queue ID IDR, and cleans up all the |
254 | * IDR, and cleans up all the messages associated with this queue. | 261 | * messages associated with this queue. |
255 | * | 262 | * |
256 | * msg_ids.mutex and the spinlock for this message queue are held | 263 | * msg_ids.mutex and the spinlock for this message queue are held |
257 | * before freeque() is called. msg_ids.mutex remains locked on exit. | 264 | * before freeque() is called. msg_ids.mutex remains locked on exit. |
@@ -278,6 +285,9 @@ static void freeque(struct ipc_namespace *ns, struct msg_queue *msq) | |||
278 | ipc_rcu_putref(msq); | 285 | ipc_rcu_putref(msq); |
279 | } | 286 | } |
280 | 287 | ||
288 | /* | ||
289 | * Called with msg_ids.mutex and ipcp locked. | ||
290 | */ | ||
281 | static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg) | 291 | static inline int msg_security(struct kern_ipc_perm *ipcp, int msgflg) |
282 | { | 292 | { |
283 | struct msg_queue *msq = container_of(ipcp, struct msg_queue, q_perm); | 293 | struct msg_queue *msq = container_of(ipcp, struct msg_queue, q_perm); |