From owner-svn-src-all@freebsd.org Thu Oct 6 14:42:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3469EAF6EC1; Thu, 6 Oct 2016 14:42:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0503BB62; Thu, 6 Oct 2016 14:42:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u96Eg7Yd025330; Thu, 6 Oct 2016 14:42:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u96Eg7WD025328; Thu, 6 Oct 2016 14:42:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201610061442.u96Eg7WD025328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 6 Oct 2016 14:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306760 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 14:42:08 -0000 Author: ae Date: Thu Oct 6 14:42:06 2016 New Revision: 306760 URL: https://svnweb.freebsd.org/changeset/base/306760 Log: Replace rw_init/rw_destroy with corresponding macros. Obtained from: Yandex LLC Modified: head/sys/net/route.c head/sys/net/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Thu Oct 6 13:53:17 2016 (r306759) +++ head/sys/net/route.c Thu Oct 6 14:42:06 2016 (r306760) @@ -352,7 +352,7 @@ rt_table_init(int offset) rh->head.rnh_masks = &rh->rmhead; /* Init locks */ - rw_init(&rh->rib_lock, "rib head lock"); + RIB_LOCK_INIT(rh); /* Finally, set base callbacks */ rh->rnh_addaddr = rn_addroute; @@ -384,7 +384,7 @@ rt_table_destroy(struct rib_head *rh) rn_walktree(&rh->rmhead.head, rt_freeentry, &rh->rmhead.head); /* Assume table is already empty */ - rw_destroy(&rh->rib_lock); + RIB_LOCK_DESTROY(rh); free(rh, M_RTABLE); } Modified: head/sys/net/route_var.h ============================================================================== --- head/sys/net/route_var.h Thu Oct 6 13:53:17 2016 (r306759) +++ head/sys/net/route_var.h Thu Oct 6 14:42:06 2016 (r306760) @@ -48,6 +48,8 @@ struct rib_head { struct radix_mask_head rmhead; /* masks radix head */ }; +#define RIB_LOCK_INIT(rh) rw_init(&(rh)->rib_lock, "rib head lock") +#define RIB_LOCK_DESTROY(rh) rw_destroy(&(rh)->rib_lock) #define RIB_RLOCK(rh) rw_rlock(&(rh)->rib_lock) #define RIB_RUNLOCK(rh) rw_runlock(&(rh)->rib_lock) #define RIB_WLOCK(rh) rw_wlock(&(rh)->rib_lock)