Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 2019 23:12:19 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354755 - head/sys/net
Message-ID:  <201911152312.xAFNCJdc054552@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Fri Nov 15 23:12:19 2019
New Revision: 354755
URL: https://svnweb.freebsd.org/changeset/base/354755

Log:
  if_llatbl: change htable_unlink_entry() to early exist if no work to do
  
  Adjust the logic in htable_unlink_entry() to the one in
  htable_link_entry() saving a block indent and making it more clear
  in which case we do not do any work.
  
  No functional change.
  
  MFC after:	3 weeks
  Sponsored by:	Netflix

Modified:
  head/sys/net/if_llatbl.c

Modified: head/sys/net/if_llatbl.c
==============================================================================
--- head/sys/net/if_llatbl.c	Fri Nov 15 23:01:43 2019	(r354754)
+++ head/sys/net/if_llatbl.c	Fri Nov 15 23:12:19 2019	(r354755)
@@ -177,15 +177,16 @@ static void
 htable_unlink_entry(struct llentry *lle)
 {
 
-	if ((lle->la_flags & LLE_LINKED) != 0) {
-		IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp);
-		CK_LIST_REMOVE(lle, lle_next);
-		lle->la_flags &= ~(LLE_VALID | LLE_LINKED);
+	if ((lle->la_flags & LLE_LINKED) == 0)
+		return;
+
+	IF_AFDATA_WLOCK_ASSERT(lle->lle_tbl->llt_ifp);
+	CK_LIST_REMOVE(lle, lle_next);
+	lle->la_flags &= ~(LLE_VALID | LLE_LINKED);
 #if 0
-		lle->lle_tbl = NULL;
-		lle->lle_head = NULL;
+	lle->lle_tbl = NULL;
+	lle->lle_head = NULL;
 #endif
-	}
 }
 
 struct prefix_match_data {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911152312.xAFNCJdc054552>