diff options
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r-- | net/tipc/msg.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h index ec5c511a9c9c..8de02ad6e352 100644 --- a/net/tipc/msg.h +++ b/net/tipc/msg.h | |||
@@ -1151,4 +1151,25 @@ static inline void tipc_skb_queue_splice_tail_init(struct sk_buff_head *list, | |||
1151 | tipc_skb_queue_splice_tail(&tmp, head); | 1151 | tipc_skb_queue_splice_tail(&tmp, head); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | /* __tipc_skb_dequeue() - dequeue the head skb according to expected seqno | ||
1155 | * @list: list to be dequeued from | ||
1156 | * @seqno: seqno of the expected msg | ||
1157 | * | ||
1158 | * returns skb dequeued from the list if its seqno is less than or equal to | ||
1159 | * the expected one, otherwise the skb is still hold | ||
1160 | * | ||
1161 | * Note: must be used with appropriate locks held only | ||
1162 | */ | ||
1163 | static inline struct sk_buff *__tipc_skb_dequeue(struct sk_buff_head *list, | ||
1164 | u16 seqno) | ||
1165 | { | ||
1166 | struct sk_buff *skb = skb_peek(list); | ||
1167 | |||
1168 | if (skb && less_eq(buf_seqno(skb), seqno)) { | ||
1169 | __skb_unlink(skb, list); | ||
1170 | return skb; | ||
1171 | } | ||
1172 | return NULL; | ||
1173 | } | ||
1174 | |||
1154 | #endif | 1175 | #endif |