* Preallocate two selfds associated with 'cookie'. Some fo_poll routines * have two select sets, one for read and another for write. */
| 1732 | * have two select sets, one for read and another for write. |
| 1733 | */ |
| 1734 | static void |
| 1735 | selfdalloc(struct thread *td, void *cookie) |
| 1736 | { |
| 1737 | struct seltd *stp; |
| 1738 | |
| 1739 | stp = td->td_sel; |
| 1740 | if (stp->st_free1 == NULL) |
| 1741 | stp->st_free1 = malloc(sizeof(*stp->st_free1), M_SELFD, M_WAITOK|M_ZERO); |
| 1742 | stp->st_free1->sf_td = stp; |
| 1743 | stp->st_free1->sf_cookie = cookie; |
| 1744 | if (stp->st_free2 == NULL) |
| 1745 | stp->st_free2 = malloc(sizeof(*stp->st_free2), M_SELFD, M_WAITOK|M_ZERO); |
| 1746 | stp->st_free2->sf_td = stp; |
| 1747 | stp->st_free2->sf_cookie = cookie; |
| 1748 | } |
| 1749 | |
| 1750 | static void |
| 1751 | selfdfree(struct seltd *stp, struct selfd *sfp) |