|
@@ -306,26 +306,18 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf,
|
|
|
|
|
|
mutex_lock(&file->mut);
|
|
mutex_lock(&file->mut);
|
|
while (list_empty(&file->event_list)) {
|
|
while (list_empty(&file->event_list)) {
|
|
- if (file->filp->f_flags & O_NONBLOCK) {
|
|
|
|
- ret = -EAGAIN;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ mutex_unlock(&file->mut);
|
|
|
|
|
|
- if (signal_pending(current)) {
|
|
|
|
- ret = -ERESTARTSYS;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ if (file->filp->f_flags & O_NONBLOCK)
|
|
|
|
+ return -EAGAIN;
|
|
|
|
+
|
|
|
|
+ if (wait_event_interruptible(file->poll_wait,
|
|
|
|
+ !list_empty(&file->event_list)))
|
|
|
|
+ return -ERESTARTSYS;
|
|
|
|
|
|
- prepare_to_wait(&file->poll_wait, &wait, TASK_INTERRUPTIBLE);
|
|
|
|
- mutex_unlock(&file->mut);
|
|
|
|
- schedule();
|
|
|
|
mutex_lock(&file->mut);
|
|
mutex_lock(&file->mut);
|
|
- finish_wait(&file->poll_wait, &wait);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if (ret)
|
|
|
|
- goto done;
|
|
|
|
-
|
|
|
|
uevent = list_entry(file->event_list.next, struct ucma_event, list);
|
|
uevent = list_entry(file->event_list.next, struct ucma_event, list);
|
|
|
|
|
|
if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST) {
|
|
if (uevent->resp.event == RDMA_CM_EVENT_CONNECT_REQUEST) {
|