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
d1ef2d91
Unverified
Commit
d1ef2d91
authored
Feb 17, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: cgfsng_create()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
77a3a03e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
cgfsng.c
src/lxc/cgroups/cgfsng.c
+8
-5
No files found.
src/lxc/cgroups/cgfsng.c
View file @
d1ef2d91
...
@@ -1746,9 +1746,8 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname)
...
@@ -1746,9 +1746,8 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname)
h
->
fullcgpath
=
NULL
;
h
->
fullcgpath
=
NULL
;
}
}
/*
/* Try to create the same cgroup in all hierarchies. Start with cgroup_pattern;
* Try to create the same cgroup in all hierarchies.
* next cgroup_pattern-1, -2, ..., -999.
* Start with cgroup_pattern; next cgroup_pattern-1, -2, ..., -999
*/
*/
static
inline
bool
cgfsng_create
(
void
*
hdata
)
static
inline
bool
cgfsng_create
(
void
*
hdata
)
{
{
...
@@ -1782,6 +1781,7 @@ again:
...
@@ -1782,6 +1781,7 @@ again:
ERROR
(
"Too many conflicting cgroup names"
);
ERROR
(
"Too many conflicting cgroup names"
);
goto
out_free
;
goto
out_free
;
}
}
if
(
idx
)
{
if
(
idx
)
{
int
ret
;
int
ret
;
...
@@ -1796,10 +1796,11 @@ again:
...
@@ -1796,10 +1796,11 @@ again:
}
}
}
}
}
}
for
(
i
=
0
;
hierarchies
[
i
];
i
++
)
{
for
(
i
=
0
;
hierarchies
[
i
];
i
++
)
{
if
(
!
create_path_for_hierarchy
(
hierarchies
[
i
],
container_cgroup
))
{
if
(
!
create_path_for_hierarchy
(
hierarchies
[
i
],
container_cgroup
))
{
int
j
;
int
j
;
ERROR
(
"Failed to create
\"
%s
\"
"
,
hierarchies
[
i
]
->
fullcgpath
);
ERROR
(
"Failed to create
cgroup
\"
%s
\"
"
,
hierarchies
[
i
]
->
fullcgpath
);
free
(
hierarchies
[
i
]
->
fullcgpath
);
free
(
hierarchies
[
i
]
->
fullcgpath
);
hierarchies
[
i
]
->
fullcgpath
=
NULL
;
hierarchies
[
i
]
->
fullcgpath
=
NULL
;
for
(
j
=
0
;
j
<
i
;
j
++
)
for
(
j
=
0
;
j
<
i
;
j
++
)
...
@@ -1808,12 +1809,14 @@ again:
...
@@ -1808,12 +1809,14 @@ again:
goto
again
;
goto
again
;
}
}
}
}
/* Done */
d
->
container_cgroup
=
container_cgroup
;
d
->
container_cgroup
=
container_cgroup
;
return
true
;
return
true
;
out_free:
out_free:
free
(
container_cgroup
);
free
(
container_cgroup
);
return
false
;
return
false
;
}
}
...
...
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