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
a58be2ad
Unverified
Commit
a58be2ad
authored
Feb 21, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: s/mountpoint/at_mnt/g
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
44585f1a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
cgfsng.c
src/lxc/cgroups/cgfsng.c
+8
-8
cgroup.c
src/lxc/cgroups/cgroup.c
+1
-1
cgroup.h
src/lxc/cgroups/cgroup.h
+9
-9
No files found.
src/lxc/cgroups/cgfsng.c
View file @
a58be2ad
...
...
@@ -407,7 +407,7 @@ static int cgroup_hierarchy_add(struct cgroup_ops *ops, int dfd_mnt, char *mnt,
new
->
fs_type
=
fs_type
;
new
->
controllers
=
controllers
;
new
->
mountpoi
nt
=
mnt
;
new
->
at_m
nt
=
mnt
;
new
->
at_base
=
base_cgroup
;
new
->
dfd_mnt
=
dfd_mnt
;
...
...
@@ -1775,9 +1775,9 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
__do_free
char
*
hierarchy_mnt
=
NULL
,
*
path2
=
NULL
;
struct
hierarchy
*
h
=
ops
->
hierarchies
[
i
];
ret
=
mkdirat
(
dfd_mnt_tmpfs
,
h
->
mountpoi
nt
,
0000
);
ret
=
mkdirat
(
dfd_mnt_tmpfs
,
h
->
at_m
nt
,
0000
);
if
(
ret
<
0
)
return
syserrno
(
false
,
"Failed to create cgroup
mountpoint %d(%s)"
,
dfd_mnt_tmpfs
,
h
->
mountpoi
nt
);
return
syserrno
(
false
,
"Failed to create cgroup
at_mnt %d(%s)"
,
dfd_mnt_tmpfs
,
h
->
at_m
nt
);
if
(
in_cgroup_ns
&&
wants_force_mount
)
{
/*
...
...
@@ -1786,7 +1786,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
* need to mount the cgroups manually.
*/
ret
=
cgroupfs_mount
(
cgroup_automount_type
,
h
,
rootfs
,
dfd_mnt_tmpfs
,
h
->
mountpoi
nt
);
dfd_mnt_tmpfs
,
h
->
at_m
nt
);
if
(
ret
<
0
)
return
false
;
...
...
@@ -1795,7 +1795,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
/* Here is where the ancient kernel section begins. */
ret
=
cgroupfs_bind_mount
(
cgroup_automount_type
,
h
,
rootfs
,
dfd_mnt_tmpfs
,
h
->
mountpoi
nt
);
dfd_mnt_tmpfs
,
h
->
at_m
nt
);
if
(
ret
<
0
)
return
false
;
...
...
@@ -1805,7 +1805,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
if
(
!
cgroup_root
)
cgroup_root
=
must_make_path
(
rootfs_mnt
,
DEFAULT_CGROUP_MOUNTPOINT
,
NULL
);
hierarchy_mnt
=
must_make_path
(
cgroup_root
,
h
->
mountpoi
nt
,
NULL
);
hierarchy_mnt
=
must_make_path
(
cgroup_root
,
h
->
at_m
nt
,
NULL
);
path2
=
must_make_path
(
hierarchy_mnt
,
h
->
at_base
,
ops
->
container_cgroup
,
NULL
);
ret
=
mkdir_p
(
path2
,
0755
);
...
...
@@ -2045,8 +2045,8 @@ static const char *cgfsng_get_cgroup_do(struct cgroup_ops *ops,
if
(
!
path
)
return
NULL
;
len
=
strlen
(
h
->
mountpoi
nt
);
if
(
!
strnequal
(
h
->
mountpoi
nt
,
DEFAULT_CGROUP_MOUNTPOINT
,
len
=
strlen
(
h
->
at_m
nt
);
if
(
!
strnequal
(
h
->
at_m
nt
,
DEFAULT_CGROUP_MOUNTPOINT
,
STRLITERALLEN
(
DEFAULT_CGROUP_MOUNTPOINT
)))
{
path
+=
STRLITERALLEN
(
DEFAULT_CGROUP_MOUNTPOINT
);
path
+=
strspn
(
path
,
"/"
);
...
...
src/lxc/cgroups/cgroup.c
View file @
a58be2ad
...
...
@@ -85,7 +85,7 @@ void cgroup_exit(struct cgroup_ops *ops)
free
(
*
p
);
free
((
*
it
)
->
cgroup2_chown
);
free
((
*
it
)
->
mountpoi
nt
);
free
((
*
it
)
->
at_m
nt
);
free
((
*
it
)
->
at_base
);
free_equal
((
*
it
)
->
container_full_path
,
...
...
src/lxc/cgroups/cgroup.h
View file @
a58be2ad
...
...
@@ -46,8 +46,8 @@ typedef enum {
* - unified hierarchy
* Either NULL, or a null-terminated list of all enabled controllers.
*
* @
mountpoi
nt
* - The
mountpoi
nt we will use.
* @
at_m
nt
* - The
at_m
nt we will use.
* - legacy hierarchy
* It will be either /sys/fs/cgroup/controller or
* /sys/fs/cgroup/controllerlist.
...
...
@@ -83,7 +83,6 @@ struct hierarchy {
*/
char
**
cgroup2_chown
;
char
**
controllers
;
char
*
mountpoint
;
char
*
container_full_path
;
char
*
container_limit_path
;
cgroupfs_type_magic_t
fs_type
;
...
...
@@ -105,8 +104,9 @@ struct hierarchy {
/* File descriptor for the monitor's cgroup. */
int
cgfd_mon
;
/* File descriptor for the controller's mountpoint @
mountpoi
nt. */
/* File descriptor for the controller's mountpoint @
at_m
nt. */
int
dfd_mnt
;
char
*
at_mnt
;
/* File descriptor for the controller's base cgroup path @at_base. */
int
dfd_base
;
...
...
@@ -236,11 +236,11 @@ static inline int cgroup_unified_fd(const struct cgroup_ops *ops)
return
ops
->
unified
->
cgfd_con
;
}
#define make_cgroup_path(__hierarchy, __first, ...)
\
({
\
const struct hierarchy *__h = __hierarchy;
\
must_make_path(DEFAULT_CGROUP_MOUNTPOINT, __h->
mountpoi
nt, \
__first, __VA_ARGS__);
\
#define make_cgroup_path(__hierarchy, __first, ...) \
({ \
const struct hierarchy *__h = __hierarchy; \
must_make_path(DEFAULT_CGROUP_MOUNTPOINT, __h->
at_m
nt, \
__first, __VA_ARGS__); \
})
#endif
/* __LXC_CGROUP_H */
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