From owner-svn-src-head@FreeBSD.ORG Tue Mar 19 05:51:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7294E2D7; Tue, 19 Mar 2013 05:51:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 56B48354; Tue, 19 Mar 2013 05:51:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r2J5pm3D056621; Tue, 19 Mar 2013 05:51:48 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r2J5pm9a056619; Tue, 19 Mar 2013 05:51:48 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201303190551.r2J5pm9a056619@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 19 Mar 2013 05:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r248490 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2013 05:51:48 -0000 Author: ae Date: Tue Mar 19 05:51:47 2013 New Revision: 248490 URL: http://svnweb.freebsd.org/changeset/base/248490 Log: Fix style and comments. Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Tue Mar 19 05:44:25 2013 (r248489) +++ head/sys/net/pfil.c Tue Mar 19 05:51:47 2013 (r248490) @@ -94,12 +94,13 @@ pfil_run_hooks(struct pfil_head *ph, str /* * pfil_try_rlock() acquires rm reader lock for specified head - * if this is immediately possible, + * if this is immediately possible. */ int pfil_try_rlock(struct pfil_head *ph, struct rm_priotracker *tracker) { - return PFIL_TRY_RLOCK(ph, tracker); + + return (PFIL_TRY_RLOCK(ph, tracker)); } /* @@ -108,6 +109,7 @@ pfil_try_rlock(struct pfil_head *ph, str void pfil_rlock(struct pfil_head *ph, struct rm_priotracker *tracker) { + PFIL_RLOCK(ph, tracker); } @@ -117,6 +119,7 @@ pfil_rlock(struct pfil_head *ph, struct void pfil_runlock(struct pfil_head *ph, struct rm_priotracker *tracker) { + PFIL_RUNLOCK(ph, tracker); } @@ -126,6 +129,7 @@ pfil_runlock(struct pfil_head *ph, struc void pfil_wlock(struct pfil_head *ph) { + PFIL_WLOCK(ph); } @@ -135,16 +139,19 @@ pfil_wlock(struct pfil_head *ph) void pfil_wunlock(struct pfil_head *ph) { + PFIL_WUNLOCK(ph); } /* - * pfil_wowned() releases writer lock for specified head. + * pfil_wowned() returns a non-zero value if the current thread owns + * an exclusive lock. */ int pfil_wowned(struct pfil_head *ph) { - return PFIL_WOWNED(ph); + + return (PFIL_WOWNED(ph)); } /* * pfil_head_register() registers a pfil_head with the packet filter hook Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Tue Mar 19 05:44:25 2013 (r248489) +++ head/sys/net/pfil.h Tue Mar 19 05:51:47 2013 (r248490) @@ -123,14 +123,14 @@ struct pfil_head *pfil_head_get(int, u_l if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) \ PFIL_LOCK_DESTROY_REAL((p)->ph_plock); \ } while (0) -#define PFIL_TRY_RLOCK(p, t) rm_try_rlock((p)->ph_plock, (t)) -#define PFIL_RLOCK(p, t) rm_rlock((p)->ph_plock, (t)) -#define PFIL_WLOCK(p) rm_wlock((p)->ph_plock) -#define PFIL_RUNLOCK(p, t) rm_runlock((p)->ph_plock, (t)) -#define PFIL_WUNLOCK(p) rm_wunlock((p)->ph_plock) -#define PFIL_WOWNED(p) rm_wowned((p)->ph_plock) -#define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock) -#define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock) +#define PFIL_TRY_RLOCK(p, t) rm_try_rlock((p)->ph_plock, (t)) +#define PFIL_RLOCK(p, t) rm_rlock((p)->ph_plock, (t)) +#define PFIL_WLOCK(p) rm_wlock((p)->ph_plock) +#define PFIL_RUNLOCK(p, t) rm_runlock((p)->ph_plock, (t)) +#define PFIL_WUNLOCK(p) rm_wunlock((p)->ph_plock) +#define PFIL_WOWNED(p) rm_wowned((p)->ph_plock) +#define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock) +#define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock) static __inline struct packet_filter_hook * pfil_hook_get(int dir, struct pfil_head *ph)