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
7e184235
Commit
7e184235
authored
May 08, 2003
by
James Morris
Committed by
David S. Miller
May 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFRM]: Use xfrm_pol_hold().
parent
4ebb54ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
include/net/xfrm.h
include/net/xfrm.h
+1
-1
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_policy.c
+10
-10
No files found.
include/net/xfrm.h
View file @
7e184235
...
...
@@ -336,7 +336,7 @@ extern struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2];
static
inline
void
xfrm_pol_hold
(
struct
xfrm_policy
*
policy
)
{
if
(
policy
)
if
(
likely
(
policy
)
)
atomic_inc
(
&
policy
->
refcnt
);
}
...
...
net/xfrm/xfrm_policy.c
View file @
7e184235
...
...
@@ -100,7 +100,7 @@ struct xfrm_policy *flow_lookup(int dir, struct flowi *fl,
fle
->
dir
==
dir
)
{
if
(
fle
->
genid
==
xfrm_policy_genid
)
{
if
((
pol
=
fle
->
pol
)
!=
NULL
)
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
local_bh_enable
();
return
pol
;
}
...
...
@@ -118,7 +118,7 @@ struct xfrm_policy *flow_lookup(int dir, struct flowi *fl,
xfrm_pol_put
(
fle
->
pol
);
fle
->
pol
=
pol
;
if
(
pol
)
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
}
else
{
if
(
flow_count
(
cpu
)
>
flow_hwm
)
flow_cache_shrink
(
cpu
);
...
...
@@ -131,7 +131,7 @@ struct xfrm_policy *flow_lookup(int dir, struct flowi *fl,
fle
->
dir
=
dir
;
fle
->
pol
=
pol
;
if
(
pol
)
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
fle
->
next
=
flow_table
[
cpu
*
XFRM_FLOWCACHE_HASH_SIZE
+
hash
];
flow_table
[
cpu
*
XFRM_FLOWCACHE_HASH_SIZE
+
hash
]
=
fle
;
}
...
...
@@ -274,7 +274,7 @@ static void xfrm_policy_timer(unsigned long data)
}
if
(
next
!=
LONG_MAX
&&
!
mod_timer
(
&
xp
->
timer
,
jiffies
+
make_jiffies
(
next
)))
atomic_inc
(
&
xp
->
refcnt
);
xfrm_pol_hold
(
xp
);
out:
xfrm_pol_put
(
xp
);
...
...
@@ -392,7 +392,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
break
;
}
}
atomic_inc
(
&
policy
->
refcnt
);
xfrm_pol_hold
(
policy
);
policy
->
next
=
pol
?
pol
->
next
:
NULL
;
*
p
=
policy
;
xfrm_policy_genid
++
;
...
...
@@ -401,7 +401,7 @@ int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl)
policy
->
curlft
.
use_time
=
0
;
if
(
policy
->
lft
.
hard_add_expires_seconds
&&
!
mod_timer
(
&
policy
->
timer
,
jiffies
+
HZ
))
atomic_inc
(
&
policy
->
refcnt
);
xfrm_pol_hold
(
policy
);
write_unlock_bh
(
&
xfrm_policy_lock
);
if
(
pol
)
{
...
...
@@ -445,7 +445,7 @@ struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete)
if
(
delete
)
xfrm_policy_genid
++
;
else
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
}
write_unlock_bh
(
&
xfrm_policy_lock
);
return
pol
;
...
...
@@ -522,7 +522,7 @@ struct xfrm_policy *xfrm_policy_lookup(int dir, struct flowi *fl,
match
=
xfrm_selector_match
(
sel
,
fl
,
family
);
if
(
match
)
{
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
break
;
}
}
...
...
@@ -540,7 +540,7 @@ struct xfrm_policy *xfrm_sk_policy_lookup(struct sock *sk, int dir, struct flowi
match
=
xfrm_selector_match
(
&
pol
->
selector
,
fl
,
sk
->
family
);
if
(
match
)
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
else
pol
=
NULL
;
}
...
...
@@ -552,7 +552,7 @@ void xfrm_sk_policy_link(struct xfrm_policy *pol, int dir)
{
pol
->
next
=
xfrm_policy_list
[
XFRM_POLICY_MAX
+
dir
];
xfrm_policy_list
[
XFRM_POLICY_MAX
+
dir
]
=
pol
;
atomic_inc
(
&
pol
->
refcnt
);
xfrm_pol_hold
(
pol
);
}
void
xfrm_sk_policy_unlink
(
struct
xfrm_policy
*
pol
,
int
dir
)
...
...
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