vserver 1.9.5.x5
[linux-2.6.git] / net / sctp / ulpqueue.c
index 0b912c8..d5dd2cf 100644 (file)
 #include <net/sctp/sm.h>
 
 /* Forward declarations for internal helpers.  */
-static inline struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
-                                                    struct sctp_ulpevent *);
-static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *,
-                                                   struct sctp_ulpevent *);
+static struct sctp_ulpevent * sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
+                                               struct sctp_ulpevent *);
+static struct sctp_ulpevent * sctp_ulpq_order(struct sctp_ulpq *,
+                                               struct sctp_ulpevent *);
 
 /* 1st Level Abstractions */
 
-/* Create a new ULP queue.  */
-struct sctp_ulpq *sctp_ulpq_new(struct sctp_association *asoc, int gfp)
-{
-       struct sctp_ulpq *ulpq;
-
-       ulpq = kmalloc(sizeof(struct sctp_ulpq), gfp);
-       if (!ulpq)
-               goto fail;
-       if (!sctp_ulpq_init(ulpq, asoc))
-               goto fail_init;
-       ulpq->malloced = 1;
-       return ulpq;
-
-fail_init:
-       kfree(ulpq);
-fail:
-       return NULL;
-}
-
 /* Initialize a ULP queue from a block of memory.  */
 struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
                                 struct sctp_association *asoc)
@@ -92,17 +73,17 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
 
 
 /* Flush the reassembly and ordering queues.  */
-void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
+static void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
 {
        struct sk_buff *skb;
        struct sctp_ulpevent *event;
 
-       while ((skb = __skb_dequeue(&ulpq->lobby))) {
+       while ((skb = __skb_dequeue(&ulpq->lobby)) != NULL) {
                event = sctp_skb2event(skb);
                sctp_ulpevent_free(event);
        }
 
-       while ((skb = __skb_dequeue(&ulpq->reasm))) {
+       while ((skb = __skb_dequeue(&ulpq->reasm)) != NULL) {
                event = sctp_skb2event(skb);
                sctp_ulpevent_free(event);
        }
@@ -157,8 +138,7 @@ int sctp_ulpq_tail_data(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
  */
 int sctp_clear_pd(struct sock *sk)
 {
-       struct sctp_opt *sp;
-       sp = sctp_sk(sk);
+       struct sctp_sock *sp = sctp_sk(sk);
 
        sp->pd_mode = 0;
        if (!skb_queue_empty(&sp->pd_lobby)) {
@@ -334,7 +314,7 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff *f_frag,
        };
 
        event = sctp_skb2event(f_frag);
-       SCTP_INC_STATS(SctpReasmUsrMsgs);
+       SCTP_INC_STATS(SCTP_MIB_REASMUSRMSGS);
 
        return event;
 }
@@ -466,8 +446,8 @@ done:
 /* Helper function to reassemble chunks.  Hold chunks on the reasm queue that
  * need reassembling.
  */
-static inline struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
-                                                  struct sctp_ulpevent *event)
+static struct sctp_ulpevent *sctp_ulpq_reasm(struct sctp_ulpq *ulpq,
+                                               struct sctp_ulpevent *event)
 {
        struct sctp_ulpevent *retval = NULL;
 
@@ -645,8 +625,8 @@ static inline void sctp_ulpq_store_ordered(struct sctp_ulpq *ulpq,
 
 }
 
-static inline struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
-                                       struct sctp_ulpevent *event)
+static struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
+                                               struct sctp_ulpevent *event)
 {
        __u16 sid, ssn;
        struct sctp_stream *in;
@@ -756,7 +736,7 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
 
        tsnmap = &ulpq->asoc->peer.tsn_map;
 
-       while ((skb = __skb_dequeue_tail(&ulpq->lobby))) {
+       while ((skb = __skb_dequeue_tail(&ulpq->lobby)) != NULL) {
                freed += skb_headlen(skb);
                event = sctp_skb2event(skb);
                tsn = event->tsn;
@@ -782,7 +762,7 @@ static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed)
        tsnmap = &ulpq->asoc->peer.tsn_map;
 
        /* Walk backwards through the list, reneges the newest tsns. */
-       while ((skb = __skb_dequeue_tail(&ulpq->reasm))) {
+       while ((skb = __skb_dequeue_tail(&ulpq->reasm)) != NULL) {
                freed += skb_headlen(skb);
                event = sctp_skb2event(skb);
                tsn = event->tsn;