wait_queue_head_t wait_send_credits;
wait_queue_head_t wait_rw_credits;
- wait_queue_head_t wait_send_pending;
- atomic_t send_pending;
-
struct work_struct post_recv_credits_work;
struct work_struct send_immediate_work;
spin_lock_init(&t->receive_credit_lock);
- init_waitqueue_head(&t->wait_send_pending);
- atomic_set(&t->send_pending, 0);
-
spin_lock_init(&t->lock_new_recv_credits);
INIT_WORK(&t->post_recv_credits_work,
}
wake_up_all(&t->wait_send_credits);
- wake_up_all(&t->wait_send_pending);
+ wake_up_all(&sc->send_io.pending.zero_wait_queue);
disable_work_sync(&t->post_recv_credits_work);
disable_work_sync(&t->send_immediate_work);
smb_direct_disconnect_rdma_connection(t);
}
- if (atomic_dec_and_test(&t->send_pending))
- wake_up(&t->wait_send_pending);
+ if (atomic_dec_and_test(&sc->send_io.pending.count))
+ wake_up(&sc->send_io.pending.zero_wait_queue);
/* iterate and free the list of messages in reverse. the list's head
* is invalid.
struct smbdirect_socket *sc = &t->socket;
int ret;
- atomic_inc(&t->send_pending);
+ atomic_inc(&sc->send_io.pending.count);
ret = ib_post_send(sc->ib.qp, wr, NULL);
if (ret) {
pr_err("failed to post send: %d\n", ret);
- if (atomic_dec_and_test(&t->send_pending))
- wake_up(&t->wait_send_pending);
+ if (atomic_dec_and_test(&sc->send_io.pending.count))
+ wake_up(&sc->send_io.pending.zero_wait_queue);
smb_direct_disconnect_rdma_connection(t);
}
return ret;
* that means all the I/Os have been out and we are good to return
*/
- wait_event(st->wait_send_pending,
- atomic_read(&st->send_pending) == 0 ||
+ wait_event(sc->send_io.pending.zero_wait_queue,
+ atomic_read(&sc->send_io.pending.count) == 0 ||
sc->status != SMBDIRECT_SOCKET_CONNECTED);
if (sc->status != SMBDIRECT_SOCKET_CONNECTED && ret == 0)
ret = -ENOTCONN;
return ret;
}
- wait_event(t->wait_send_pending,
- atomic_read(&t->send_pending) == 0 ||
+ wait_event(sc->send_io.pending.zero_wait_queue,
+ atomic_read(&sc->send_io.pending.count) == 0 ||
sc->status != SMBDIRECT_SOCKET_CONNECTED);
if (sc->status != SMBDIRECT_SOCKET_CONNECTED)
return -ENOTCONN;