Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109620929
D25535.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25535.diff
View Options
Index: head/sys/net/route/nhop_ctl.c
===================================================================
--- head/sys/net/route/nhop_ctl.c
+++ head/sys/net/route/nhop_ctl.c
@@ -598,10 +598,19 @@
destroy_nhop(nh_priv);
}
-int
+void
nhop_ref_object(struct nhop_object *nh)
{
+ u_int old;
+ old = refcount_acquire(&nh->nh_priv->nh_refcnt);
+ KASSERT(old > 0, ("%s: nhop object %p has 0 refs", __func__, nh));
+}
+
+int
+nhop_try_ref_object(struct nhop_object *nh)
+{
+
return (refcount_acquire_if_not_zero(&nh->nh_priv->nh_refcnt));
}
@@ -654,7 +663,7 @@
nhop_ref_any(struct nhop_object *nh)
{
- return (nhop_ref_object(nh));
+ return (nhop_try_ref_object(nh));
}
void
Index: head/sys/net/route/shared.h
===================================================================
--- head/sys/net/route/shared.h
+++ head/sys/net/route/shared.h
@@ -51,7 +51,8 @@
void nhops_init(void);
int nhops_init_rib(struct rib_head *rh);
void nhops_destroy_rib(struct rib_head *rh);
-int nhop_ref_object(struct nhop_object *nh);
+void nhop_ref_object(struct nhop_object *nh);
+int nhop_try_ref_object(struct nhop_object *nh);
int nhop_ref_any(struct nhop_object *nh);
void nhop_free_any(struct nhop_object *nh);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 8, 2:07 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16527455
Default Alt Text
D25535.diff (1 KB)
Attached To
Mode
D25535: Introduce nhop_ref_locked_object().
Attached
Detach File
Event Timeline
Log In to Comment