Lines Matching +full:wakeup +full:- +full:method

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
71 * filter is loaded with the same name as a leaked one we re-use the entry.
80 if (strcmp(p->accf_name, filt->accf_name) == 0) { in accept_filt_add()
81 if (p->accf_callback != NULL) { in accept_filt_add()
85 p->accf_callback = filt->accf_callback; in accept_filt_add()
107 p->accf_callback = NULL; in accept_filt_del()
118 if (strcmp(p->accf_name, name) == 0) in accept_filt_get()
147 error = accept_filt_del(accfp->accf_name); in accept_filt_generic_mod_event()
177 if (so->sol_accept_filter == NULL) { in accept_filt_getopt()
181 strcpy(afap->af_name, so->sol_accept_filter->accf_name); in accept_filt_getopt()
182 if (so->sol_accept_filter_str != NULL) in accept_filt_getopt()
183 strcpy(afap->af_arg, so->sol_accept_filter_str); in accept_filt_getopt()
204 if (sopt == NULL || sopt->sopt_val == NULL) { in accept_filt_setopt()
206 int wakeup; in accept_filt_setopt() local
213 if (so->sol_accept_filter == NULL) { in accept_filt_setopt()
217 if (so->sol_accept_filter->accf_destroy != NULL) in accept_filt_setopt()
218 so->sol_accept_filter->accf_destroy(so); in accept_filt_setopt()
219 if (so->sol_accept_filter_str != NULL) in accept_filt_setopt()
220 free(so->sol_accept_filter_str, M_ACCF); in accept_filt_setopt()
221 so->sol_accept_filter = NULL; in accept_filt_setopt()
222 so->sol_accept_filter_arg = NULL; in accept_filt_setopt()
223 so->sol_accept_filter_str = NULL; in accept_filt_setopt()
224 so->so_options &= ~SO_ACCEPTFILTER; in accept_filt_setopt()
230 wakeup = 0; in accept_filt_setopt()
231 TAILQ_FOREACH_SAFE(sp, &so->sol_incomp, so_list, sp1) { in accept_filt_setopt()
233 if (sp->so_options & SO_ACCEPTFILTER) { in accept_filt_setopt()
234 TAILQ_REMOVE(&so->sol_incomp, sp, so_list); in accept_filt_setopt()
235 TAILQ_INSERT_TAIL(&so->sol_comp, sp, so_list); in accept_filt_setopt()
236 sp->so_qstate = SQ_COMP; in accept_filt_setopt()
237 sp->so_options &= ~SO_ACCEPTFILTER; in accept_filt_setopt()
238 so->sol_incqlen--; in accept_filt_setopt()
239 so->sol_qlen++; in accept_filt_setopt()
240 wakeup = 1; in accept_filt_setopt()
244 if (wakeup) in accept_filt_setopt()
252 * Pre-allocate any memory we may need later to avoid blocking at in accept_filt_setopt()
257 afap->af_name[sizeof(afap->af_name)-1] = '\0'; in accept_filt_setopt()
258 afap->af_arg[sizeof(afap->af_arg)-1] = '\0'; in accept_filt_setopt()
263 afp = accept_filt_get(afap->af_name); in accept_filt_setopt()
268 if (afp->accf_create != NULL && afap->af_name[0] != '\0') { in accept_filt_setopt()
269 size_t len = strlen(afap->af_name) + 1; in accept_filt_setopt()
271 strcpy(accept_filter_str, afap->af_name); in accept_filt_setopt()
283 if (__predict_false(so->sol_accept_filter != NULL)) { in accept_filt_setopt()
289 * Invoke the accf_create() method of the filter if required. The in accept_filt_setopt()
293 if (afp->accf_create != NULL) { in accept_filt_setopt()
294 accept_filter_arg = afp->accf_create(so, afap->af_arg); in accept_filt_setopt()
300 so->sol_accept_filter = afp; in accept_filt_setopt()
301 so->sol_accept_filter_arg = accept_filter_arg; in accept_filt_setopt()
302 so->sol_accept_filter_str = accept_filter_str; in accept_filt_setopt()
304 so->so_options |= SO_ACCEPTFILTER; in accept_filt_setopt()