Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
de6fe132
Unverified
Commit
de6fe132
authored
Mar 28, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: better helper naming
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
c468e4d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
cgfsng.c
src/lxc/cgroups/cgfsng.c
+12
-12
No files found.
src/lxc/cgroups/cgfsng.c
View file @
de6fe132
...
...
@@ -945,7 +945,7 @@ static void lxc_cgfsng_print_basecg_debuginfo(char *basecginfo, char **klist,
TRACE
(
"named subsystem %d: %s"
,
k
,
*
it
);
}
static
int
cgroup_
rmdir
(
struct
hierarchy
**
hierarchies
,
static
int
cgroup_
tree_remove
(
struct
hierarchy
**
hierarchies
,
const
char
*
container_cgroup
)
{
if
(
!
container_cgroup
||
!
hierarchies
)
...
...
@@ -976,7 +976,7 @@ struct generic_userns_exec_data {
char
*
path
;
};
static
int
cgroup_
rmdir
_wrapper
(
void
*
data
)
static
int
cgroup_
tree_remove
_wrapper
(
void
*
data
)
{
struct
generic_userns_exec_data
*
arg
=
data
;
uid_t
nsuid
=
(
arg
->
conf
->
root_nsuid_map
!=
NULL
)
?
0
:
arg
->
conf
->
init_uid
;
...
...
@@ -996,7 +996,7 @@ static int cgroup_rmdir_wrapper(void *data)
return
log_error_errno
(
-
1
,
errno
,
"Failed to setresuid(%d, %d, %d)"
,
(
int
)
nsuid
,
(
int
)
nsuid
,
(
int
)
nsuid
);
return
cgroup_
rmdir
(
arg
->
hierarchies
,
arg
->
container_cgroup
);
return
cgroup_
tree_remove
(
arg
->
hierarchies
,
arg
->
container_cgroup
);
}
__cgfsng_ops
static
void
cgfsng_payload_destroy
(
struct
cgroup_ops
*
ops
,
...
...
@@ -1035,10 +1035,10 @@ __cgfsng_ops static void cgfsng_payload_destroy(struct cgroup_ops *ops,
.
hierarchies
=
ops
->
hierarchies
,
.
origuid
=
0
,
};
ret
=
userns_exec_1
(
handler
->
conf
,
cgroup_
rmdir_wrapper
,
&
wrap
,
"cgroup_rmdir
_wrapper"
);
ret
=
userns_exec_1
(
handler
->
conf
,
cgroup_
tree_remove_wrapper
,
&
wrap
,
"cgroup_tree_remove
_wrapper"
);
}
else
{
ret
=
cgroup_
rmdir
(
ops
->
hierarchies
,
ops
->
container_cgroup
);
ret
=
cgroup_
tree_remove
(
ops
->
hierarchies
,
ops
->
container_cgroup
);
}
if
(
ret
<
0
)
SYSWARN
(
"Failed to destroy cgroups"
);
...
...
@@ -1145,7 +1145,7 @@ static int mkdir_eexist_on_last(const char *dir, mode_t mode)
return
0
;
}
static
bool
c
reate_cgroup_tre
e
(
struct
hierarchy
*
h
,
const
char
*
cgroup_tree
,
static
bool
c
group_tree_creat
e
(
struct
hierarchy
*
h
,
const
char
*
cgroup_tree
,
const
char
*
cgroup_leaf
,
bool
payload
)
{
__do_free
char
*
path
=
NULL
;
...
...
@@ -1185,7 +1185,7 @@ static bool create_cgroup_tree(struct hierarchy *h, const char *cgroup_tree,
return
true
;
}
static
void
cgroup_
remove_leaf
(
struct
hierarchy
*
h
,
bool
payload
)
static
void
cgroup_
tree_leaf_remove
(
struct
hierarchy
*
h
,
bool
payload
)
{
__do_free
char
*
full_path
=
NULL
;
...
...
@@ -1257,12 +1257,12 @@ __cgfsng_ops static inline bool cgfsng_monitor_create(struct cgroup_ops *ops,
sprintf
(
suffix
,
"-%d"
,
idx
);
for
(
i
=
0
;
ops
->
hierarchies
[
i
];
i
++
)
{
if
(
c
reate_cgroup_tre
e
(
ops
->
hierarchies
[
i
],
cgroup_tree
,
monitor_cgroup
,
false
))
if
(
c
group_tree_creat
e
(
ops
->
hierarchies
[
i
],
cgroup_tree
,
monitor_cgroup
,
false
))
continue
;
ERROR
(
"Failed to create cgroup
\"
%s
\"
"
,
ops
->
hierarchies
[
i
]
->
monitor_full_path
?:
"(null)"
);
for
(
int
j
=
0
;
j
<
i
;
j
++
)
cgroup_
remove_leaf
(
ops
->
hierarchies
[
j
],
false
);
cgroup_
tree_leaf_remove
(
ops
->
hierarchies
[
j
],
false
);
idx
++
;
break
;
...
...
@@ -1336,12 +1336,12 @@ __cgfsng_ops static inline bool cgfsng_payload_create(struct cgroup_ops *ops,
sprintf
(
suffix
,
"-%d"
,
idx
);
for
(
i
=
0
;
ops
->
hierarchies
[
i
];
i
++
)
{
if
(
c
reate_cgroup_tre
e
(
ops
->
hierarchies
[
i
],
cgroup_tree
,
container_cgroup
,
true
))
if
(
c
group_tree_creat
e
(
ops
->
hierarchies
[
i
],
cgroup_tree
,
container_cgroup
,
true
))
continue
;
ERROR
(
"Failed to create cgroup
\"
%s
\"
"
,
ops
->
hierarchies
[
i
]
->
container_full_path
?:
"(null)"
);
for
(
int
j
=
0
;
j
<
i
;
j
++
)
cgroup_
remove_leaf
(
ops
->
hierarchies
[
j
],
true
);
cgroup_
tree_leaf_remove
(
ops
->
hierarchies
[
j
],
true
);
idx
++
;
break
;
...
...
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