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
8425d6aa
Commit
8425d6aa
authored
Jan 09, 2012
by
Eric W. Biederman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysctl: Factor out insert_header and erase_header
Signed-off-by:
Eric W. Biederman
<
ebiederm@xmission.com
>
parent
e0d04529
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
fs/proc/proc_sysctl.c
fs/proc/proc_sysctl.c
+13
-3
No files found.
fs/proc/proc_sysctl.c
View file @
8425d6aa
...
...
@@ -57,6 +57,17 @@ static void init_header(struct ctl_table_header *head,
head
->
parent
=
NULL
;
}
static
void
erase_header
(
struct
ctl_table_header
*
head
)
{
list_del_init
(
&
head
->
ctl_entry
);
}
static
void
insert_header
(
struct
ctl_table_header
*
header
)
{
header
->
parent
->
count
++
;
list_add_tail
(
&
header
->
ctl_entry
,
&
header
->
set
->
list
);
}
/* called under sysctl_lock */
static
int
use_table
(
struct
ctl_table_header
*
p
)
{
...
...
@@ -96,7 +107,7 @@ static void start_unregistering(struct ctl_table_header *p)
* do not remove from the list until nobody holds it; walking the
* list in do_sysctl() relies on that.
*/
list_del_init
(
&
p
->
ctl_entry
);
erase_header
(
p
);
}
static
void
sysctl_head_get
(
struct
ctl_table_header
*
head
)
...
...
@@ -974,8 +985,7 @@ struct ctl_table_header *__register_sysctl_table(
}
if
(
sysctl_check_dups
(
namespaces
,
header
,
path
,
table
))
goto
fail_locked
;
header
->
parent
->
count
++
;
list_add_tail
(
&
header
->
ctl_entry
,
&
header
->
set
->
list
);
insert_header
(
header
);
spin_unlock
(
&
sysctl_lock
);
return
header
;
...
...
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