Lines Matching refs:ps
89 poll_slot_t ps[MAX_POLL]; member
341 ts[h].ps[i].pfd.fd = -1; in init_poll()
354 static inline void set_poll(poll_slot_t* ps, int fd, int type, int flags, in set_poll() argument
356 ps->pfd.fd = fd; in set_poll()
357 ps->user_id = user_id; in set_poll()
358 if (ps->type != 0 && ps->type != type) in set_poll()
361 ps->type, type); in set_poll()
362 ps->type = type; in set_poll()
363 ps->flags = flags; in set_poll()
364 ps->pfd.events = flags2pevents(flags); in set_poll()
365 ps->pfd.revents = 0; in set_poll()
372 poll_slot_t* ps = ts[h].ps; in add_poll() local
375 if (ps[i].pfd.fd == fd) { in add_poll()
378 set_poll(&ps[i], fd, type, flags | ps[i].flags, user_id); in add_poll()
380 } else if (empty < 0 && ps[i].pfd.fd == -1) in add_poll()
385 set_poll(&ps[empty], fd, type, flags, user_id); in add_poll()
391 static inline void remove_poll(int h, poll_slot_t* ps, int flags) { in remove_poll() argument
392 if (flags == ps->flags) { in remove_poll()
395 memset(ps, 0, sizeof(*ps)); in remove_poll()
396 ps->pfd.fd = -1; in remove_poll()
399 ps->flags &= ~flags; in remove_poll()
401 ps->pfd.events = flags2pevents(ps->flags); in remove_poll()
421 poll_slot_t* poll_slot = &ts[h].ps[i]; in process_cmd_sock()
451 asrt(pfds[i].fd == ts[h].ps[ps_i].pfd.fd); in process_data_sock()
452 uint32_t user_id = ts[h].ps[ps_i].user_id; in process_data_sock()
453 int type = ts[h].ps[ps_i].type; in process_data_sock()
464 remove_poll(h, &ts[h].ps[ps_i], ts[h].ps[ps_i].flags); in process_data_sock()
466 remove_poll(h, &ts[h].ps[ps_i], in process_data_sock()
487 if (ts[h].ps[ps_i].pfd.fd >= 0) { in prepare_poll_fds()
488 pfds[pfd_i] = ts[h].ps[ps_i].pfd; in prepare_poll_fds()