| 384 | MODULE_VERSION(sysvmsg, 1); |
| 385 | |
| 386 | static void |
| 387 | msg_freehdr(struct msg *msghdr) |
| 388 | { |
| 389 | while (msghdr->msg_ts > 0) { |
| 390 | short next; |
| 391 | if (msghdr->msg_spot < 0 || msghdr->msg_spot >= msginfo.msgseg) |
| 392 | panic("msghdr->msg_spot out of range"); |
| 393 | next = msgmaps[msghdr->msg_spot].next; |
| 394 | msgmaps[msghdr->msg_spot].next = free_msgmaps; |
| 395 | free_msgmaps = msghdr->msg_spot; |
| 396 | nfree_msgmaps++; |
| 397 | msghdr->msg_spot = next; |
| 398 | if (msghdr->msg_ts >= msginfo.msgssz) |
| 399 | msghdr->msg_ts -= msginfo.msgssz; |
| 400 | else |
| 401 | msghdr->msg_ts = 0; |
| 402 | } |
| 403 | if (msghdr->msg_spot != -1) |
| 404 | panic("msghdr->msg_spot != -1"); |
| 405 | msghdr->msg_next = free_msghdrs; |
| 406 | free_msghdrs = msghdr; |
| 407 | #ifdef MAC |
| 408 | mac_sysvmsg_cleanup(msghdr); |
| 409 | #endif |
| 410 | } |
| 411 | |
| 412 | static void |
| 413 | msq_remove(struct msqid_kernel *msqkptr) |
no test coverage detected