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
6a32c817
Unverified
Commit
6a32c817
authored
Feb 21, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: s/cgfd_mon/dfd_mon/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e33870e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
cgfsng.c
src/lxc/cgroups/cgfsng.c
+11
-11
cgroup.c
src/lxc/cgroups/cgroup.c
+2
-2
cgroup.h
src/lxc/cgroups/cgroup.h
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
6a32c817
...
...
@@ -403,7 +403,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
new
->
dfd_con
=
-
EBADF
;
new
->
cgfd_limit
=
-
EBADF
;
new
->
cg
fd_mon
=
-
EBADF
;
new
->
d
fd_mon
=
-
EBADF
;
new
->
fs_type
=
fs_type
;
new
->
controllers
=
controllers
;
...
...
@@ -814,7 +814,7 @@ static bool cgroup_tree_create(struct cgroup_ops *ops, struct lxc_conf *conf,
else
h
->
container_limit_path
=
h
->
container_full_path
;
}
else
{
h
->
cg
fd_mon
=
move_fd
(
fd_final
);
h
->
d
fd_mon
=
move_fd
(
fd_final
);
}
return
true
;
...
...
@@ -834,10 +834,10 @@ static void cgroup_tree_prune_leaf(struct hierarchy *h, const char *path_prune,
close_equal
(
h
->
dfd_con
,
h
->
cgfd_limit
);
}
else
{
/* Check whether we actually created the cgroup to prune. */
if
(
h
->
cg
fd_mon
<
0
)
if
(
h
->
d
fd_mon
<
0
)
prune
=
false
;
close_prot_errno_disarm
(
h
->
cg
fd_mon
);
close_prot_errno_disarm
(
h
->
d
fd_mon
);
}
/* We didn't create this cgroup. */
...
...
@@ -1183,20 +1183,20 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
struct
hierarchy
*
h
=
ops
->
hierarchies
[
i
];
int
ret
;
ret
=
lxc_writeat
(
h
->
cg
fd_mon
,
"cgroup.procs"
,
monitor
,
monitor_len
);
ret
=
lxc_writeat
(
h
->
d
fd_mon
,
"cgroup.procs"
,
monitor
,
monitor_len
);
if
(
ret
)
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup %d"
,
h
->
cg
fd_mon
);
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup %d"
,
h
->
d
fd_mon
);
TRACE
(
"Moved monitor into cgroup %d"
,
h
->
cg
fd_mon
);
TRACE
(
"Moved monitor into cgroup %d"
,
h
->
d
fd_mon
);
if
(
handler
->
transient_pid
<=
0
)
continue
;
ret
=
lxc_writeat
(
h
->
cg
fd_mon
,
"cgroup.procs"
,
transient
,
transient_len
);
ret
=
lxc_writeat
(
h
->
d
fd_mon
,
"cgroup.procs"
,
transient
,
transient_len
);
if
(
ret
)
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup %d"
,
h
->
cg
fd_mon
);
return
log_error_errno
(
false
,
errno
,
"Failed to enter cgroup %d"
,
h
->
d
fd_mon
);
TRACE
(
"Moved transient process into cgroup %d"
,
h
->
cg
fd_mon
);
TRACE
(
"Moved transient process into cgroup %d"
,
h
->
d
fd_mon
);
/*
* we don't keep the fds for non-unified hierarchies around
...
...
@@ -1205,7 +1205,7 @@ __cgfsng_ops static bool cgfsng_monitor_enter(struct cgroup_ops *ops,
* lot of them.
*/
if
(
!
is_unified_hierarchy
(
h
))
close_prot_errno_disarm
(
h
->
cg
fd_mon
);
close_prot_errno_disarm
(
h
->
d
fd_mon
);
}
handler
->
transient_pid
=
-
1
;
...
...
src/lxc/cgroups/cgroup.c
View file @
6a32c817
...
...
@@ -93,8 +93,8 @@ void cgroup_exit(struct cgroup_ops *ops)
close_equal
((
*
it
)
->
dfd_con
,
(
*
it
)
->
cgfd_limit
);
if
((
*
it
)
->
cg
fd_mon
>=
0
)
close
((
*
it
)
->
cg
fd_mon
);
if
((
*
it
)
->
d
fd_mon
>=
0
)
close
((
*
it
)
->
d
fd_mon
);
close_equal
((
*
it
)
->
dfd_base
,
(
*
it
)
->
dfd_mnt
);
...
...
src/lxc/cgroups/cgroup.h
View file @
6a32c817
...
...
@@ -102,7 +102,7 @@ struct hierarchy {
int
cgfd_limit
;
/* File descriptor for the monitor's cgroup. */
int
cg
fd_mon
;
int
d
fd_mon
;
/* File descriptor for the controller's mountpoint @at_mnt. */
int
dfd_mnt
;
...
...
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