diff options
Diffstat (limited to 'net/rds/recv.c')
-rw-r--r-- | net/rds/recv.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/net/rds/recv.c b/net/rds/recv.c index f2118c51cfa3..fdff33c7b432 100644 --- a/net/rds/recv.c +++ b/net/rds/recv.c | |||
@@ -46,12 +46,14 @@ void rds_inc_init(struct rds_incoming *inc, struct rds_connection *conn, | |||
46 | inc->i_saddr = saddr; | 46 | inc->i_saddr = saddr; |
47 | inc->i_rdma_cookie = 0; | 47 | inc->i_rdma_cookie = 0; |
48 | } | 48 | } |
49 | EXPORT_SYMBOL_GPL(rds_inc_init); | ||
49 | 50 | ||
50 | void rds_inc_addref(struct rds_incoming *inc) | 51 | void rds_inc_addref(struct rds_incoming *inc) |
51 | { | 52 | { |
52 | rdsdebug("addref inc %p ref %d\n", inc, atomic_read(&inc->i_refcount)); | 53 | rdsdebug("addref inc %p ref %d\n", inc, atomic_read(&inc->i_refcount)); |
53 | atomic_inc(&inc->i_refcount); | 54 | atomic_inc(&inc->i_refcount); |
54 | } | 55 | } |
56 | EXPORT_SYMBOL_GPL(rds_inc_addref); | ||
55 | 57 | ||
56 | void rds_inc_put(struct rds_incoming *inc) | 58 | void rds_inc_put(struct rds_incoming *inc) |
57 | { | 59 | { |
@@ -62,6 +64,7 @@ void rds_inc_put(struct rds_incoming *inc) | |||
62 | inc->i_conn->c_trans->inc_free(inc); | 64 | inc->i_conn->c_trans->inc_free(inc); |
63 | } | 65 | } |
64 | } | 66 | } |
67 | EXPORT_SYMBOL_GPL(rds_inc_put); | ||
65 | 68 | ||
66 | static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk, | 69 | static void rds_recv_rcvbuf_delta(struct rds_sock *rs, struct sock *sk, |
67 | struct rds_cong_map *map, | 70 | struct rds_cong_map *map, |
@@ -237,6 +240,7 @@ out: | |||
237 | if (rs) | 240 | if (rs) |
238 | rds_sock_put(rs); | 241 | rds_sock_put(rs); |
239 | } | 242 | } |
243 | EXPORT_SYMBOL_GPL(rds_recv_incoming); | ||
240 | 244 | ||
241 | /* | 245 | /* |
242 | * be very careful here. This is being called as the condition in | 246 | * be very careful here. This is being called as the condition in |
@@ -409,18 +413,18 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
409 | if (msg_flags & MSG_OOB) | 413 | if (msg_flags & MSG_OOB) |
410 | goto out; | 414 | goto out; |
411 | 415 | ||
412 | /* If there are pending notifications, do those - and nothing else */ | 416 | while (1) { |
413 | if (!list_empty(&rs->rs_notify_queue)) { | 417 | /* If there are pending notifications, do those - and nothing else */ |
414 | ret = rds_notify_queue_get(rs, msg); | 418 | if (!list_empty(&rs->rs_notify_queue)) { |
415 | goto out; | 419 | ret = rds_notify_queue_get(rs, msg); |
416 | } | 420 | break; |
421 | } | ||
417 | 422 | ||
418 | if (rs->rs_cong_notify) { | 423 | if (rs->rs_cong_notify) { |
419 | ret = rds_notify_cong(rs, msg); | 424 | ret = rds_notify_cong(rs, msg); |
420 | goto out; | 425 | break; |
421 | } | 426 | } |
422 | 427 | ||
423 | while (1) { | ||
424 | if (!rds_next_incoming(rs, &inc)) { | 428 | if (!rds_next_incoming(rs, &inc)) { |
425 | if (nonblock) { | 429 | if (nonblock) { |
426 | ret = -EAGAIN; | 430 | ret = -EAGAIN; |
@@ -428,7 +432,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
428 | } | 432 | } |
429 | 433 | ||
430 | timeo = wait_event_interruptible_timeout(*sk->sk_sleep, | 434 | timeo = wait_event_interruptible_timeout(*sk->sk_sleep, |
431 | rds_next_incoming(rs, &inc), | 435 | (!list_empty(&rs->rs_notify_queue) |
436 | || rs->rs_cong_notify | ||
437 | || rds_next_incoming(rs, &inc)), | ||
432 | timeo); | 438 | timeo); |
433 | rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, | 439 | rdsdebug("recvmsg woke inc %p timeo %ld\n", inc, |
434 | timeo); | 440 | timeo); |