| 761 | } |
| 762 | |
| 763 | int |
| 764 | alloc_unr_specific(struct unrhdr *uh, u_int item) |
| 765 | { |
| 766 | void *p1, *p2; |
| 767 | int i; |
| 768 | |
| 769 | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "alloc_unr_specific"); |
| 770 | |
| 771 | p1 = Malloc(sizeof(struct unr)); |
| 772 | p2 = Malloc(sizeof(struct unr)); |
| 773 | |
| 774 | mtx_lock(uh->mtx); |
| 775 | i = alloc_unr_specificl(uh, item, &p1, &p2); |
| 776 | mtx_unlock(uh->mtx); |
| 777 | |
| 778 | if (p1 != NULL) |
| 779 | Free(p1); |
| 780 | if (p2 != NULL) |
| 781 | Free(p2); |
| 782 | |
| 783 | return (i); |
| 784 | } |
| 785 | |
| 786 | /* |
| 787 | * Free a unr. |