From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB912C43381 for ; Wed, 20 Mar 2019 16:24:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA6842146E for ; Wed, 20 Mar 2019 16:24:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553099096; bh=klypif5VQCHHiWVAAHA+nYWl1prkxrno/jAHXzieXp4=; h=From:To:Cc:Subject:Date:List-ID:From; b=Gm+QpXjpZ3C6J09qLumqjYB7RvGbgbdU60I5Zjn5xwDEx51i/WMq/Bxd+fbBQHJGT FI9lf7Gp0XnUQBrO5k2PAwAj5xqHWOkY9yN1TJM7rPp1gEDwHO1twLKqfdQJdNANqb uPAQPTQX7bdH9EdudatD2Gby20Dw78ciPHMt/Vwo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbfCTQYz (ORCPT ); Wed, 20 Mar 2019 12:24:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:55812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbfCTQYw (ORCPT ); Wed, 20 Mar 2019 12:24:52 -0400 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF8DD2186A; Wed, 20 Mar 2019 16:24:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553099092; bh=klypif5VQCHHiWVAAHA+nYWl1prkxrno/jAHXzieXp4=; h=From:To:Cc:Subject:Date:From; b=vS11J1DmZjar3MXsi45/0EC0m9c0wJFvl+/aGgDYoOUWpHjNLiSI9oXwLS1T/gIdG mUieSYMXFyYF9WFmxhurKVWzEz6swnwbNm2qAyXWL0u3bbBIUjQG3Qzfs7HNr5DXEq WO/aVqS3/fKSy3T/oNu9YuuRkVuXl05SWTZb507k= From: David Ahern To: davem@davemloft.net, netdev@vger.kernel.org Cc: weiwan@google.com, David Ahern Subject: [PATCH net-next] ipv6: Remove fallback argument from ip6_hold_safe Date: Wed, 20 Mar 2019 09:24:50 -0700 Message-Id: <20190320162450.29103-1-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern net and null_fallback are redundant. Remove null_fallback in favor of !net check. Signed-off-by: David Ahern --- net/ipv6/route.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 4ef4bbdb49d4..c9a2f0f2dea6 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1015,14 +1015,13 @@ static struct fib6_node* fib6_backtrack(struct fib6_node *fn, } } -static bool ip6_hold_safe(struct net *net, struct rt6_info **prt, - bool null_fallback) +static bool ip6_hold_safe(struct net *net, struct rt6_info **prt) { struct rt6_info *rt = *prt; if (dst_hold_safe(&rt->dst)) return true; - if (null_fallback) { + if (net) { rt = net->ipv6.ip6_null_entry; dst_hold(&rt->dst); } else { @@ -1089,7 +1088,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct net *net, /* Search through exception table */ rt = rt6_find_cached_rt(f6i, &fl6->daddr, &fl6->saddr); if (rt) { - if (ip6_hold_safe(net, &rt, true)) + if (ip6_hold_safe(net, &rt)) dst_use_noref(&rt->dst, jiffies); } else if (f6i == net->ipv6.fib6_null_entry) { rt = net->ipv6.ip6_null_entry; @@ -1240,7 +1239,7 @@ static struct rt6_info *rt6_get_pcpu_route(struct fib6_info *rt) pcpu_rt = *p; if (pcpu_rt) - ip6_hold_safe(NULL, &pcpu_rt, false); + ip6_hold_safe(NULL, &pcpu_rt); return pcpu_rt; } @@ -1865,7 +1864,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, /*Search through exception table */ rt = rt6_find_cached_rt(f6i, &fl6->daddr, &fl6->saddr); if (rt) { - if (ip6_hold_safe(net, &rt, true)) + if (ip6_hold_safe(net, &rt)) dst_use_noref(&rt->dst, jiffies); rcu_read_unlock(); @@ -2480,7 +2479,7 @@ static struct rt6_info *__ip6_route_redirect(struct net *net, out: if (ret) - ip6_hold_safe(net, &ret, true); + ip6_hold_safe(net, &ret); else ret = ip6_create_rt_rcu(rt); -- 2.11.0