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
39a30bc9
Unverified
Commit
39a30bc9
authored
Feb 24, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: fix get_hierarchy() for unified hierarchy
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3a2b6cae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
cgfsng.c
src/lxc/cgroups/cgfsng.c
+11
-5
No files found.
src/lxc/cgroups/cgfsng.c
View file @
39a30bc9
...
@@ -318,7 +318,7 @@ struct hierarchy *get_hierarchy(const char *c)
...
@@ -318,7 +318,7 @@ struct hierarchy *get_hierarchy(const char *c)
!
hierarchies
[
i
]
->
controllers
[
0
])
!
hierarchies
[
i
]
->
controllers
[
0
])
return
hierarchies
[
i
];
return
hierarchies
[
i
];
return
NULL
;
continue
;
}
}
if
(
string_in_list
(
hierarchies
[
i
]
->
controllers
,
c
))
if
(
string_in_list
(
hierarchies
[
i
]
->
controllers
,
c
))
...
@@ -1295,8 +1295,11 @@ static bool cg_hybrid_init(void)
...
@@ -1295,8 +1295,11 @@ static bool cg_hybrid_init(void)
controller_list
=
cg_unified_get_controllers
(
cgv2_ctrl_path
);
controller_list
=
cg_unified_get_controllers
(
cgv2_ctrl_path
);
free
(
cgv2_ctrl_path
);
free
(
cgv2_ctrl_path
);
if
(
!
controller_list
)
if
(
!
controller_list
)
{
controller_list
=
cg_unified_make_empty_controller
();
controller_list
=
cg_unified_make_empty_controller
();
CGFSNG_DEBUG
(
"No controllers are enabled for "
"delegation in the unified hierarchy
\n
"
);
}
}
}
new
=
add_hierarchy
(
controller_list
,
mountpoint
,
base_cgroup
,
type
);
new
=
add_hierarchy
(
controller_list
,
mountpoint
,
base_cgroup
,
type
);
...
@@ -2343,13 +2346,16 @@ static bool cgfsng_unfreeze(void *hdata)
...
@@ -2343,13 +2346,16 @@ static bool cgfsng_unfreeze(void *hdata)
return
true
;
return
true
;
}
}
static
const
char
*
cgfsng_get_cgroup
(
void
*
hdata
,
const
char
*
subsystem
)
static
const
char
*
cgfsng_get_cgroup
(
void
*
hdata
,
const
char
*
controller
)
{
{
struct
hierarchy
*
h
;
struct
hierarchy
*
h
;
h
=
get_hierarchy
(
subsystem
);
h
=
get_hierarchy
(
controller
);
if
(
!
h
)
if
(
!
h
)
{
SYSERROR
(
"Failed to find hierarchy for controller
\"
%s
\"
"
,
controller
?
controller
:
"(null)"
);
return
NULL
;
return
NULL
;
}
return
h
->
fullcgpath
?
h
->
fullcgpath
+
strlen
(
h
->
mountpoint
)
:
NULL
;
return
h
->
fullcgpath
?
h
->
fullcgpath
+
strlen
(
h
->
mountpoint
)
:
NULL
;
}
}
...
...
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