diff options
author | Kip Macy <kmacy@FreeBSD.org> | 2008-03-23 22:34:16 +0000 |
---|---|---|
committer | Kip Macy <kmacy@FreeBSD.org> | 2008-03-23 22:34:16 +0000 |
commit | 3d5853271ef665a16b87426ca06a7bb65da126e0 (patch) | |
tree | 2f3f744bc5af41a2c2bfe8e948714275fe894bfd /sys/netinet/in_pcb.c | |
parent | 702006ff768436c56f282a7272c7e156ad8151dd (diff) | |
download | src-3d5853271ef665a16b87426ca06a7bb65da126e0.tar.gz src-3d5853271ef665a16b87426ca06a7bb65da126e0.zip |
Insulate inpcb consumers outside the stack from the lock type and offset within the pcb by adding accessor functions.
Reviewed by: rwatson
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=177530
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 95ffe3796372..08373a43e0bb 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1204,6 +1204,50 @@ ipport_tick(void *xtp) callout_reset(&ipport_tick_callout, hz, ipport_tick, NULL); } +void +inp_wlock(struct inpcb *inp) +{ + + INP_LOCK(inp); +} + +void +inp_wunlock(struct inpcb *inp) +{ + + INP_UNLOCK(inp); +} + +void +inp_rlock(struct inpcb *inp) +{ + + INP_LOCK(inp); +} + +void +inp_runlock(struct inpcb *inp) +{ + + INP_UNLOCK(inp); +} + +#ifdef INVARIANTS +void +inp_wlock_assert(struct inpcb *inp) +{ + + INP_LOCK_ASSERT(inp); +} + +void +inp_wunlock_assert(struct inpcb *inp) +{ + + INP_UNLOCK_ASSERT(inp); +} +#endif + #ifdef DDB static void db_print_indent(int indent) |