Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Verlässliche Systemsoftware
projects
osv
Commits
53c0f270
Commit
53c0f270
authored
12 years ago
by
Guy Zana
Browse files
Options
Downloads
Patches
Plain Diff
net: go back to rwlock in radix.c
parent
4d34da9e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bsd/sys/net/radix.c
+1
-0
1 addition, 0 deletions
bsd/sys/net/radix.c
bsd/sys/net/radix.h
+12
-10
12 additions, 10 deletions
bsd/sys/net/radix.h
with
13 additions
and
10 deletions
bsd/sys/net/radix.c
+
1
−
0
View file @
53c0f270
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include
<osv/mutex.h>
#include
<osv/mutex.h>
#include
<bsd/porting/netport.h>
#include
<bsd/porting/netport.h>
#include
<bsd/porting/rwlock.h>
#include
<bsd/sys/sys/param.h>
#include
<bsd/sys/sys/param.h>
#include
<bsd/sys/net/radix.h>
#include
<bsd/sys/net/radix.h>
...
...
This diff is collapsed.
Click to expand it.
bsd/sys/net/radix.h
+
12
−
10
View file @
53c0f270
...
@@ -122,7 +122,7 @@ struct radix_node_head {
...
@@ -122,7 +122,7 @@ struct radix_node_head {
(
struct
radix_node
*
rn
,
struct
radix_node_head
*
head
);
(
struct
radix_node
*
rn
,
struct
radix_node_head
*
head
);
struct
radix_node
rnh_nodes
[
3
];
/* empty tree for common case */
struct
radix_node
rnh_nodes
[
3
];
/* empty tree for common case */
#ifdef _KERNEL
#ifdef _KERNEL
struct
cmutex
rnh_lock
;
/* locks entire radix tree */
struct
rwlock
rnh_lock
;
/* locks entire radix tree */
#endif
#endif
};
};
...
@@ -132,16 +132,18 @@ struct radix_node_head {
...
@@ -132,16 +132,18 @@ struct radix_node_head {
} while (0)
} while (0)
#define Free(p) free((char *)p);
#define Free(p) free((char *)p);
/* FIXME: This was an encapsulation for rwlock, now a mutex */
#define RADIX_NODE_HEAD_LOCK_INIT(rnh) \
#define RADIX_NODE_HEAD_LOCK_INIT(rnh) bzero((void*)&rnh->rnh_lock, sizeof(struct cmutex))
rw_init_flags(&(rnh)->rnh_lock, "radix node head", 0)
#define RADIX_NODE_HEAD_LOCK(rnh) mutex_lock(&rnh->rnh_lock)
#define RADIX_NODE_HEAD_LOCK(rnh) rw_wlock(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_UNLOCK(rnh) mutex_unlock(&rnh->rnh_lock)
#define RADIX_NODE_HEAD_UNLOCK(rnh) rw_wunlock(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_RLOCK(rnh) mutex_lock(&rnh->rnh_lock)
#define RADIX_NODE_HEAD_RLOCK(rnh) rw_rlock(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_RUNLOCK(rnh) mutex_unlock(&rnh->rnh_lock)
#define RADIX_NODE_HEAD_RUNLOCK(rnh) rw_runlock(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_LOCK_TRY_UPGRADE(rnh) rw_try_upgrade(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_DESTROY(rnh) do{}while(0)
#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) do{}while(0)
#define RADIX_NODE_HEAD_DESTROY(rnh) rw_destroy(&(rnh)->rnh_lock)
#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) do{}while(0)
#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_LOCKED)
#define RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, RA_WLOCKED)
void
rn_init
(
int
);
void
rn_init
(
int
);
int
rn_inithead
(
void
**
,
int
);
int
rn_inithead
(
void
**
,
int
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment