Fix style and comments.

This commit is contained in:
Andrey V. Elsukov 2013-03-19 05:51:47 +00:00
parent 8863cc408c
commit 5474386bd3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248490
2 changed files with 19 additions and 12 deletions

View File

@ -94,12 +94,13 @@ pfil_run_hooks(struct pfil_head *ph, struct mbuf **mp, struct ifnet *ifp,
/*
* 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, struct rm_priotracker *tracker)
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 rm_priotracker *tracker)
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, struct rm_priotracker *tracker)
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

View File

@ -123,14 +123,14 @@ struct pfil_head *pfil_head_get(int, u_long);
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)