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
Kirill Smelkov
linux
Commits
6e77cc47
Commit
6e77cc47
authored
Jun 17, 2018
by
Matthew Wilcox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert net_namespace to new IDA API
Signed-off-by:
Matthew Wilcox
<
willy@infradead.org
>
parent
4c9ca2fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
net/core/net_namespace.c
net/core/net_namespace.c
+6
-10
No files found.
net/core/net_namespace.c
View file @
6e77cc47
...
...
@@ -973,22 +973,18 @@ static int register_pernet_operations(struct list_head *list,
int
error
;
if
(
ops
->
id
)
{
again:
error
=
ida_get_new_above
(
&
net_generic_ids
,
MIN_PERNET_OPS_ID
,
ops
->
id
);
if
(
error
<
0
)
{
if
(
error
==
-
EAGAIN
)
{
ida_pre_get
(
&
net_generic_ids
,
GFP_KERNEL
);
goto
again
;
}
error
=
ida_alloc_min
(
&
net_generic_ids
,
MIN_PERNET_OPS_ID
,
GFP_KERNEL
);
if
(
error
<
0
)
return
error
;
}
*
ops
->
id
=
error
;
max_gen_ptrs
=
max
(
max_gen_ptrs
,
*
ops
->
id
+
1
);
}
error
=
__register_pernet_operations
(
list
,
ops
);
if
(
error
)
{
rcu_barrier
();
if
(
ops
->
id
)
ida_
remov
e
(
&
net_generic_ids
,
*
ops
->
id
);
ida_
fre
e
(
&
net_generic_ids
,
*
ops
->
id
);
}
return
error
;
...
...
@@ -999,7 +995,7 @@ static void unregister_pernet_operations(struct pernet_operations *ops)
__unregister_pernet_operations
(
ops
);
rcu_barrier
();
if
(
ops
->
id
)
ida_
remov
e
(
&
net_generic_ids
,
*
ops
->
id
);
ida_
fre
e
(
&
net_generic_ids
,
*
ops
->
id
);
}
/**
...
...
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