]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/skbuff.h
Merge tag 'for-linus-20191129' of git://git.kernel.dk/linux-block
[linux.git] / include / linux / skbuff.h
index 8688f7adfda71d955fb93004ade88cb80ab2c5b7..7af5bec7d3b0e08d06e0c9912be846030a1c2f87 100644 (file)
@@ -1795,7 +1795,7 @@ static inline struct sk_buff *skb_peek_next(struct sk_buff *skb,
  */
 static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
 {
-       struct sk_buff *skb = list_->prev;
+       struct sk_buff *skb = READ_ONCE(list_->prev);
 
        if (skb == (struct sk_buff *)list_)
                skb = NULL;
@@ -1861,7 +1861,9 @@ static inline void __skb_insert(struct sk_buff *newsk,
                                struct sk_buff *prev, struct sk_buff *next,
                                struct sk_buff_head *list)
 {
-       /* see skb_queue_empty_lockless() for the opposite READ_ONCE() */
+       /* See skb_queue_empty_lockless() and skb_peek_tail()
+        * for the opposite READ_ONCE()
+        */
        WRITE_ONCE(newsk->next, next);
        WRITE_ONCE(newsk->prev, prev);
        WRITE_ONCE(next->prev, newsk);
@@ -2277,12 +2279,12 @@ static inline void *pskb_pull(struct sk_buff *skb, unsigned int len)
        return unlikely(len > skb->len) ? NULL : __pskb_pull(skb, len);
 }
 
-static inline int pskb_may_pull(struct sk_buff *skb, unsigned int len)
+static inline bool pskb_may_pull(struct sk_buff *skb, unsigned int len)
 {
        if (likely(len <= skb_headlen(skb)))
-               return 1;
+               return true;
        if (unlikely(len > skb->len))
-               return 0;
+               return false;
        return __pskb_pull_tail(skb, len - skb_headlen(skb)) != NULL;
 }
 
@@ -3656,9 +3658,12 @@ static inline void skb_get_new_timestamp(const struct sk_buff *skb,
 }
 
 static inline void skb_get_timestampns(const struct sk_buff *skb,
-                                      struct timespec *stamp)
+                                      struct __kernel_old_timespec *stamp)
 {
-       *stamp = ktime_to_timespec(skb->tstamp);
+       struct timespec64 ts = ktime_to_timespec64(skb->tstamp);
+
+       stamp->tv_sec = ts.tv_sec;
+       stamp->tv_nsec = ts.tv_nsec;
 }
 
 static inline void skb_get_new_timestampns(const struct sk_buff *skb,