Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
0a182454
Commit
0a182454
authored
Apr 07, 2003
by
James Morris
Committed by
David S. Miller
Apr 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Really move type destructor out of spinlock.
parent
88f3b6af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
19 deletions
+14
-19
net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c
+14
-19
No files found.
net/xfrm/xfrm_state.c
View file @
0a182454
...
@@ -60,9 +60,12 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
...
@@ -60,9 +60,12 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x)
kfree
(
x
->
calg
);
kfree
(
x
->
calg
);
if
(
x
->
encap
)
if
(
x
->
encap
)
kfree
(
x
->
encap
);
kfree
(
x
->
encap
);
if
(
x
->
type
)
if
(
x
->
type
)
{
x
->
type
->
destructor
(
x
);
xfrm_put_type
(
x
->
type
);
xfrm_put_type
(
x
->
type
);
}
kfree
(
x
);
kfree
(
x
);
wake_up
(
&
km_waitq
);
}
}
static
void
xfrm_state_gc_task
(
void
*
data
)
static
void
xfrm_state_gc_task
(
void
*
data
)
...
@@ -196,11 +199,8 @@ void __xfrm_state_destroy(struct xfrm_state *x)
...
@@ -196,11 +199,8 @@ void __xfrm_state_destroy(struct xfrm_state *x)
static
void
__xfrm_state_delete
(
struct
xfrm_state
*
x
)
static
void
__xfrm_state_delete
(
struct
xfrm_state
*
x
)
{
{
int
kill
=
0
;
if
(
x
->
km
.
state
!=
XFRM_STATE_DEAD
)
{
if
(
x
->
km
.
state
!=
XFRM_STATE_DEAD
)
{
x
->
km
.
state
=
XFRM_STATE_DEAD
;
x
->
km
.
state
=
XFRM_STATE_DEAD
;
kill
=
1
;
spin_lock
(
&
xfrm_state_lock
);
spin_lock
(
&
xfrm_state_lock
);
list_del
(
&
x
->
bydst
);
list_del
(
&
x
->
bydst
);
atomic_dec
(
&
x
->
refcnt
);
atomic_dec
(
&
x
->
refcnt
);
...
@@ -219,22 +219,17 @@ static void __xfrm_state_delete(struct xfrm_state *x)
...
@@ -219,22 +219,17 @@ static void __xfrm_state_delete(struct xfrm_state *x)
*/
*/
if
(
atomic_read
(
&
x
->
refcnt
)
>
2
)
if
(
atomic_read
(
&
x
->
refcnt
)
>
2
)
xfrm_flush_bundles
(
x
);
xfrm_flush_bundles
(
x
);
}
/* All xfrm_state objects are created by one of two possible
/* All xfrm_state objects are created by one of two possible
* paths:
* paths:
*
*
* 1) xfrm_state_alloc --> xfrm_state_insert
* 2) xfrm_state_lookup --> xfrm_state_insert
* 2) xfrm_state_lookup --> xfrm_state_insert
*
*
* The xfrm_state_lookup or xfrm_state_alloc call gives a
* The xfrm_state_lookup or xfrm_state_alloc call gives a
* reference, and that is what we are dropping here.
* reference, and that is what we are dropping here.
*/
*/
atomic_dec
(
&
x
->
refcnt
);
atomic_dec
(
&
x
->
refcnt
);
}
if
(
kill
&&
x
->
type
)
x
->
type
->
destructor
(
x
);
wake_up
(
&
km_waitq
);
}
}
void
xfrm_state_delete
(
struct
xfrm_state
*
x
)
void
xfrm_state_delete
(
struct
xfrm_state
*
x
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment