]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/core/ucm.c
IB/cm: Include HCA ACK delay in local ACK timeout
[linux-2.6] / drivers / infiniband / core / ucm.c
index f15220a0ee75dda635079975df75dfe406996d05..424983f5b1ee249f5685907d6f695c03c20d4c4a 100644 (file)
@@ -407,29 +407,18 @@ static ssize_t ib_ucm_event(struct ib_ucm_file *file,
 
        mutex_lock(&file->file_mutex);
        while (list_empty(&file->events)) {
+               mutex_unlock(&file->file_mutex);
 
-               if (file->filp->f_flags & O_NONBLOCK) {
-                       result = -EAGAIN;
-                       break;
-               }
+               if (file->filp->f_flags & O_NONBLOCK)
+                       return -EAGAIN;
 
-               if (signal_pending(current)) {
-                       result = -ERESTARTSYS;
-                       break;
-               }
+               if (wait_event_interruptible(file->poll_wait,
+                                            !list_empty(&file->events)))
+                       return -ERESTARTSYS;
 
-               prepare_to_wait(&file->poll_wait, &wait, TASK_INTERRUPTIBLE);
-
-               mutex_unlock(&file->file_mutex);
-               schedule();
                mutex_lock(&file->file_mutex);
-
-               finish_wait(&file->poll_wait, &wait);
        }
 
-       if (result)
-               goto done;
-
        uevent = list_entry(file->events.next, struct ib_ucm_event, file_list);
 
        if (ib_ucm_new_cm_id(uevent->resp.event)) {
@@ -834,7 +823,6 @@ static ssize_t ib_ucm_send_rep(struct ib_ucm_file *file,
        param.private_data_len    = cmd.len;
        param.responder_resources = cmd.responder_resources;
        param.initiator_depth     = cmd.initiator_depth;
-       param.target_ack_delay    = cmd.target_ack_delay;
        param.failover_accepted   = cmd.failover_accepted;
        param.flow_control        = cmd.flow_control;
        param.rnr_retry_count     = cmd.rnr_retry_count;
@@ -1221,7 +1209,7 @@ static void ib_ucm_release_class_dev(struct class_device *class_dev)
        kfree(dev);
 }
 
-static struct file_operations ucm_fops = {
+static const struct file_operations ucm_fops = {
        .owner   = THIS_MODULE,
        .open    = ib_ucm_open,
        .release = ib_ucm_close,