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
b1b1a60f
Unverified
Commit
b1b1a60f
authored
Feb 21, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: s/container_limit_path/path_lim/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
67ed60ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
cgfsng.c
src/lxc/cgroups/cgfsng.c
+7
-7
cgroup.c
src/lxc/cgroups/cgroup.c
+1
-1
cgroup.h
src/lxc/cgroups/cgroup.h
+3
-3
No files found.
src/lxc/cgroups/cgfsng.c
View file @
b1b1a60f
...
...
@@ -444,7 +444,7 @@ static int cgroup_tree_remove(struct hierarchy **hierarchies, const char *path_p
else
TRACE
(
"Removed cgroup tree %d(%s)"
,
h
->
dfd_base
,
path_prune
);
free_equal
(
h
->
container_limit_path
,
h
->
path_con
);
free_equal
(
h
->
path_lim
,
h
->
path_con
);
}
return
0
;
...
...
@@ -810,9 +810,9 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
h
->
dfd_lim
=
move_fd
(
fd_limit
);
if
(
limit_path
)
h
->
container_limit_path
=
move_ptr
(
limit_path
);
h
->
path_lim
=
move_ptr
(
limit_path
);
else
h
->
container_limit_path
=
h
->
path_con
;
h
->
path_lim
=
h
->
path_con
;
}
else
{
h
->
dfd_mon
=
move_fd
(
fd_final
);
}
...
...
@@ -830,7 +830,7 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
if
(
h
->
dfd_lim
<
0
)
prune
=
false
;
free_equal
(
h
->
path_con
,
h
->
container_limit_path
);
free_equal
(
h
->
path_con
,
h
->
path_lim
);
close_equal
(
h
->
dfd_con
,
h
->
dfd_lim
);
}
else
{
/* Check whether we actually created the cgroup to prune. */
...
...
@@ -2039,7 +2039,7 @@ static const char *cgfsng_get_cgroup_do(struct cgroup_ops *ops,
"Failed to find hierarchy for controller
\"
%s
\"
"
,
maybe_empty
(
controller
));
if
(
limiting
)
path
=
h
->
container_limit_path
;
path
=
h
->
path_lim
;
else
path
=
h
->
path_con
;
if
(
!
path
)
...
...
@@ -2681,7 +2681,7 @@ static int cg_legacy_set_data(struct cgroup_ops *ops, const char *filename,
if
(
ret
)
return
ret
;
}
return
lxc_write_openat
(
h
->
container_limit_path
,
filename
,
value
,
strlen
(
value
));
return
lxc_write_openat
(
h
->
path_lim
,
filename
,
value
,
strlen
(
value
));
}
__cgfsng_ops
static
bool
cgfsng_setup_limits_legacy
(
struct
cgroup_ops
*
ops
,
...
...
@@ -2809,7 +2809,7 @@ __cgfsng_ops static bool cgfsng_setup_limits(struct cgroup_ops *ops,
if
(
strnequal
(
"devices"
,
cg
->
subsystem
,
7
))
ret
=
bpf_device_cgroup_prepare
(
ops
,
conf
,
cg
->
subsystem
,
cg
->
value
);
else
ret
=
lxc_write_openat
(
h
->
container_limit_path
,
cg
->
subsystem
,
cg
->
value
,
strlen
(
cg
->
value
));
ret
=
lxc_write_openat
(
h
->
path_lim
,
cg
->
subsystem
,
cg
->
value
,
strlen
(
cg
->
value
));
if
(
ret
<
0
)
return
log_error_errno
(
false
,
errno
,
"Failed to set
\"
%s
\"
to
\"
%s
\"
"
,
cg
->
subsystem
,
cg
->
value
);
...
...
src/lxc/cgroups/cgroup.c
View file @
b1b1a60f
...
...
@@ -89,7 +89,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free
((
*
it
)
->
at_base
);
free_equal
((
*
it
)
->
path_con
,
(
*
it
)
->
container_limit_path
);
(
*
it
)
->
path_lim
);
close_equal
((
*
it
)
->
dfd_con
,
(
*
it
)
->
dfd_lim
);
...
...
src/lxc/cgroups/cgroup.h
View file @
b1b1a60f
...
...
@@ -64,7 +64,7 @@ typedef enum {
* @path_con
* - The full path to the container's cgroup.
*
* @
container_limit_path
* @
path_lim
* - The full path to the container's limiting cgroup. May simply point to
* path_con.
*
...
...
@@ -83,7 +83,6 @@ struct hierarchy {
*/
char
**
cgroup2_chown
;
char
**
controllers
;
char
*
container_limit_path
;
cgroupfs_type_magic_t
fs_type
;
/* cgroup2 only */
...
...
@@ -96,10 +95,11 @@ struct hierarchy {
/*
* File descriptor for the container's limiting cgroup
* @
container_limit_path
.
* @
path_lim
.
* Will be equal to @dfd_con if no limiting cgroup has been requested.
*/
int
dfd_lim
;
char
*
path_lim
;
/* File descriptor for the monitor's cgroup. */
int
dfd_mon
;
...
...
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