aboutsummaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pfil.c15
-rw-r--r--sys/net/pfil.h16
2 files changed, 19 insertions, 12 deletions
diff --git a/sys/net/pfil.c b/sys/net/pfil.c
index 06da0be79099..9939d72a15aa 100644
--- a/sys/net/pfil.c
+++ b/sys/net/pfil.c
@@ -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
diff --git a/sys/net/pfil.h b/sys/net/pfil.h
index fabfe9aa0e79..9cdb4225f43d 100644
--- a/sys/net/pfil.h
+++ b/sys/net/pfil.h
@@ -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)