sctp: delay calls to sk_data_ready() as much as possible
[cascardo/linux.git] / net / sctp / ulpqueue.c
index ce469d6..72e5b3e 100644 (file)
@@ -264,7 +264,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
                sctp_ulpq_clear_pd(ulpq);
 
        if (queue == &sk->sk_receive_queue)
-               sk->sk_data_ready(sk);
+               sctp_sk(sk)->pending_data_ready = 1;
        return 1;
 
 out_free:
@@ -1140,5 +1140,5 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, gfp_t gfp)
 
        /* If there is data waiting, send it up the socket now. */
        if (sctp_ulpq_clear_pd(ulpq) || ev)
-               sk->sk_data_ready(sk);
+               sctp_sk(sk)->pending_data_ready = 1;
 }