tcp: Try to restore large SKBs while SACK processing
[pandora-kernel.git] / include / linux / skbuff.h
index a01b6f8..acf17af 100644 (file)
@@ -492,6 +492,19 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
        return (skb->next == (struct sk_buff *) list);
 }
 
+/**
+ *     skb_queue_is_first - check if skb is the first entry in the queue
+ *     @list: queue head
+ *     @skb: buffer
+ *
+ *     Returns true if @skb is the first buffer on the list.
+ */
+static inline bool skb_queue_is_first(const struct sk_buff_head *list,
+                                     const struct sk_buff *skb)
+{
+       return (skb->prev == (struct sk_buff *) list);
+}
+
 /**
  *     skb_queue_next - return the next packet in the queue
  *     @list: queue head
@@ -510,6 +523,24 @@ static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list,
        return skb->next;
 }
 
+/**
+ *     skb_queue_prev - return the prev packet in the queue
+ *     @list: queue head
+ *     @skb: current buffer
+ *
+ *     Return the prev packet in @list before @skb.  It is only valid to
+ *     call this if skb_queue_is_first() evaluates to false.
+ */
+static inline struct sk_buff *skb_queue_prev(const struct sk_buff_head *list,
+                                            const struct sk_buff *skb)
+{
+       /* This BUG_ON may seem severe, but if we just return then we
+        * are going to dereference garbage.
+        */
+       BUG_ON(skb_queue_is_first(list, skb));
+       return skb->prev;
+}
+
 /**
  *     skb_get - reference buffer
  *     @skb: buffer to reference
@@ -1652,6 +1683,8 @@ extern int             skb_splice_bits(struct sk_buff *skb,
 extern void           skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
 extern void           skb_split(struct sk_buff *skb,
                                 struct sk_buff *skb1, const u32 len);
+extern int            skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
+                                int shiftlen);
 
 extern struct sk_buff *skb_segment(struct sk_buff *skb, int features);