Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933320AbbHKW76 (ORCPT ); Tue, 11 Aug 2015 18:59:58 -0400 Received: from mail-pd0-f181.google.com ([209.85.192.181]:34888 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933260AbbHKW7x (ORCPT ); Tue, 11 Aug 2015 18:59:53 -0400 From: Joe Stringer To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, pablo@netfilter.org, kaber@trash.net, jpettit@nicira.com, pshelar@nicira.com, azhou@nicira.com, jesse@nicira.com, fwestpha@redhat.com, hannes@redhat.com, tgraf@noironetworks.com Subject: [PATCHv3 net-next 04/10] dst: Add __skb_dst_copy() variation Date: Tue, 11 Aug 2015 15:59:15 -0700 Message-Id: <1439333961-24474-5-git-send-email-joestringer@nicira.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439333961-24474-1-git-send-email-joestringer@nicira.com> References: <1439333961-24474-1-git-send-email-joestringer@nicira.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1192 Lines: 40 This variation on skb_dst_copy() doesn't require two skbs. Signed-off-by: Joe Stringer --- include/net/dst.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/net/dst.h b/include/net/dst.h index 2578811..0539940 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -285,13 +285,18 @@ static inline void skb_dst_drop(struct sk_buff *skb) } } -static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb) +static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst) { - nskb->_skb_refdst = oskb->_skb_refdst; + nskb->_skb_refdst = refdst; if (!(nskb->_skb_refdst & SKB_DST_NOREF)) dst_clone(skb_dst(nskb)); } +static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb) +{ + __skb_dst_copy(nskb, oskb->_skb_refdst); +} + /** * skb_dst_force - makes sure skb dst is refcounted * @skb: buffer -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/