| 118 | } |
| 119 | |
| 120 | int PollDriver::add_event(int fd, int cur_mask, int add_mask) { |
| 121 | ldout(cct, 10) << __func__ << " add event to fd=" << fd << " mask=" |
| 122 | << add_mask << dendl; |
| 123 | int op, events = 0; |
| 124 | op = cur_mask == EVENT_NONE ? POLL_ADD: POLL_MOD; |
| 125 | |
| 126 | add_mask |= cur_mask; /* Merge old events */ |
| 127 | if (add_mask & EVENT_READABLE) { |
| 128 | events |= POLLIN; |
| 129 | } |
| 130 | if (add_mask & EVENT_WRITABLE) { |
| 131 | events |= POLLOUT; |
| 132 | } |
| 133 | int ret = poll_ctl(fd, op, events); |
| 134 | return ret; |
| 135 | } |
| 136 | |
| 137 | int PollDriver::del_event(int fd, int cur_mask, int delmask) { |
| 138 | ldout(cct, 10) << __func__ << " del event fd=" << fd << " cur mask=" |
no outgoing calls