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
d0308f0c
Unverified
Commit
d0308f0c
authored
Sep 21, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: mark ops with __cgfsng_ops__ attribute
Helps to easily tell the cgfsng ops functions from helpers. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
4bb538ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
23 deletions
+30
-23
cgfsng.c
src/lxc/cgroups/cgfsng.c
+30
-23
No files found.
src/lxc/cgroups/cgfsng.c
View file @
d0308f0c
...
@@ -67,6 +67,8 @@
...
@@ -67,6 +67,8 @@
#include "include/strlcat.h"
#include "include/strlcat.h"
#endif
#endif
#define __cgfsng_ops__
lxc_log_define
(
cgfsng
,
cgroup
);
lxc_log_define
(
cgfsng
,
cgroup
);
static
void
free_string_list
(
char
**
clist
)
static
void
free_string_list
(
char
**
clist
)
...
@@ -1101,7 +1103,7 @@ static int cgroup_rmdir_wrapper(void *data)
...
@@ -1101,7 +1103,7 @@ static int cgroup_rmdir_wrapper(void *data)
return
cgroup_rmdir
(
arg
->
hierarchies
,
arg
->
container_cgroup
);
return
cgroup_rmdir
(
arg
->
hierarchies
,
arg
->
container_cgroup
);
}
}
static
void
cgfsng_destroy
(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
)
__cgfsng_ops__
static
void
cgfsng_destroy
(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
)
{
{
int
ret
;
int
ret
;
struct
generic_userns_exec_data
wrap
;
struct
generic_userns_exec_data
wrap
;
...
@@ -1229,8 +1231,8 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname)
...
@@ -1229,8 +1231,8 @@ static void remove_path_for_hierarchy(struct hierarchy *h, char *cgname)
/* Try to create the same cgroup in all hierarchies. Start with cgroup_pattern;
/* Try to create the same cgroup in all hierarchies. Start with cgroup_pattern;
* next cgroup_pattern-1, -2, ..., -999.
* next cgroup_pattern-1, -2, ..., -999.
*/
*/
static
inline
bool
cgfsng_create
(
struct
cgroup_ops
*
ops
,
__cgfsng_ops__
static
inline
bool
cgfsng_create
(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
)
struct
lxc_handler
*
handler
)
{
{
int
i
;
int
i
;
size_t
len
;
size_t
len
;
...
@@ -1305,7 +1307,7 @@ out_free:
...
@@ -1305,7 +1307,7 @@ out_free:
return
false
;
return
false
;
}
}
static
bool
cgfsng_enter
(
struct
cgroup_ops
*
ops
,
pid_t
pid
)
__cgfsng_ops__
static
bool
cgfsng_enter
(
struct
cgroup_ops
*
ops
,
pid_t
pid
)
{
{
int
i
,
len
;
int
i
,
len
;
char
pidstr
[
25
];
char
pidstr
[
25
];
...
@@ -1431,7 +1433,8 @@ static int chown_cgroup_wrapper(void *data)
...
@@ -1431,7 +1433,8 @@ static int chown_cgroup_wrapper(void *data)
return
0
;
return
0
;
}
}
static
bool
cgfsng_chown
(
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
)
__cgfsng_ops__
static
bool
cgfsng_chown
(
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
)
{
{
struct
generic_userns_exec_data
wrap
;
struct
generic_userns_exec_data
wrap
;
...
@@ -1580,8 +1583,9 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
...
@@ -1580,8 +1583,9 @@ static inline int cg_mount_cgroup_full(int type, struct hierarchy *h,
return
__cg_mount_direct
(
type
,
h
,
controllerpath
);
return
__cg_mount_direct
(
type
,
h
,
controllerpath
);
}
}
static
bool
cgfsng_mount
(
struct
cgroup_ops
*
ops
,
struct
lxc_handler
*
handler
,
__cgfsng_ops__
static
bool
cgfsng_mount
(
struct
cgroup_ops
*
ops
,
const
char
*
root
,
int
type
)
struct
lxc_handler
*
handler
,
const
char
*
root
,
int
type
)
{
{
int
i
,
ret
;
int
i
,
ret
;
char
*
tmpfspath
=
NULL
;
char
*
tmpfspath
=
NULL
;
...
@@ -1730,7 +1734,7 @@ static int recursive_count_nrtasks(char *dirname)
...
@@ -1730,7 +1734,7 @@ static int recursive_count_nrtasks(char *dirname)
return
count
;
return
count
;
}
}
static
int
cgfsng_nrtasks
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops__
static
int
cgfsng_nrtasks
(
struct
cgroup_ops
*
ops
)
{
{
int
count
;
int
count
;
char
*
path
;
char
*
path
;
...
@@ -1745,7 +1749,7 @@ static int cgfsng_nrtasks(struct cgroup_ops *ops)
...
@@ -1745,7 +1749,7 @@ static int cgfsng_nrtasks(struct cgroup_ops *ops)
}
}
/* Only root needs to escape to the cgroup of its init. */
/* Only root needs to escape to the cgroup of its init. */
static
bool
cgfsng_escape
(
const
struct
cgroup_ops
*
ops
)
__cgfsng_ops__
static
bool
cgfsng_escape
(
const
struct
cgroup_ops
*
ops
)
{
{
int
i
;
int
i
;
...
@@ -1771,7 +1775,7 @@ static bool cgfsng_escape(const struct cgroup_ops *ops)
...
@@ -1771,7 +1775,7 @@ static bool cgfsng_escape(const struct cgroup_ops *ops)
return
true
;
return
true
;
}
}
static
int
cgfsng_num_hierarchies
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops__
static
int
cgfsng_num_hierarchies
(
struct
cgroup_ops
*
ops
)
{
{
int
i
;
int
i
;
...
@@ -1781,7 +1785,7 @@ static int cgfsng_num_hierarchies(struct cgroup_ops *ops)
...
@@ -1781,7 +1785,7 @@ static int cgfsng_num_hierarchies(struct cgroup_ops *ops)
return
i
;
return
i
;
}
}
static
bool
cgfsng_get_hierarchies
(
struct
cgroup_ops
*
ops
,
int
n
,
char
***
out
)
__cgfsng_ops__
static
bool
cgfsng_get_hierarchies
(
struct
cgroup_ops
*
ops
,
int
n
,
char
***
out
)
{
{
int
i
;
int
i
;
...
@@ -1801,7 +1805,7 @@ static bool cgfsng_get_hierarchies(struct cgroup_ops *ops, int n, char ***out)
...
@@ -1801,7 +1805,7 @@ static bool cgfsng_get_hierarchies(struct cgroup_ops *ops, int n, char ***out)
/* TODO: If the unified cgroup hierarchy grows a freezer controller this needs
/* TODO: If the unified cgroup hierarchy grows a freezer controller this needs
* to be adapted.
* to be adapted.
*/
*/
static
bool
cgfsng_unfreeze
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops__
static
bool
cgfsng_unfreeze
(
struct
cgroup_ops
*
ops
)
{
{
int
ret
;
int
ret
;
char
*
fullpath
;
char
*
fullpath
;
...
@@ -1820,8 +1824,8 @@ static bool cgfsng_unfreeze(struct cgroup_ops *ops)
...
@@ -1820,8 +1824,8 @@ static bool cgfsng_unfreeze(struct cgroup_ops *ops)
return
true
;
return
true
;
}
}
static
const
char
*
cgfsng_get_cgroup
(
struct
cgroup_ops
*
ops
,
__cgfsng_ops__
static
const
char
*
cgfsng_get_cgroup
(
struct
cgroup_ops
*
ops
,
const
char
*
controller
)
const
char
*
controller
)
{
{
struct
hierarchy
*
h
;
struct
hierarchy
*
h
;
...
@@ -1919,8 +1923,8 @@ on_error:
...
@@ -1919,8 +1923,8 @@ on_error:
return
fret
;
return
fret
;
}
}
static
bool
cgfsng_attach
(
struct
cgroup_ops
*
ops
,
const
char
*
name
,
__cgfsng_ops__
static
bool
cgfsng_attach
(
struct
cgroup_ops
*
ops
,
const
char
*
name
,
const
char
*
lxcpath
,
pid_t
pid
)
const
char
*
lxcpath
,
pid_t
pid
)
{
{
int
i
,
len
,
ret
;
int
i
,
len
,
ret
;
char
pidstr
[
25
];
char
pidstr
[
25
];
...
@@ -1966,8 +1970,9 @@ static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
...
@@ -1966,8 +1970,9 @@ static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
* don't have a cgroup_data set up, so we ask the running container through the
* don't have a cgroup_data set up, so we ask the running container through the
* commands API for the cgroup path.
* commands API for the cgroup path.
*/
*/
static
int
cgfsng_get
(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
char
*
value
,
__cgfsng_ops__
static
int
cgfsng_get
(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
size_t
len
,
const
char
*
name
,
const
char
*
lxcpath
)
char
*
value
,
size_t
len
,
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
=
-
1
;
int
ret
=
-
1
;
size_t
controller_len
;
size_t
controller_len
;
...
@@ -2004,8 +2009,9 @@ static int cgfsng_get(struct cgroup_ops *ops, const char *filename, char *value,
...
@@ -2004,8 +2009,9 @@ static int cgfsng_get(struct cgroup_ops *ops, const char *filename, char *value,
* don't have a cgroup_data set up, so we ask the running container through the
* don't have a cgroup_data set up, so we ask the running container through the
* commands API for the cgroup path.
* commands API for the cgroup path.
*/
*/
static
int
cgfsng_set
(
struct
cgroup_ops
*
ops
,
const
char
*
filename
,
__cgfsng_ops__
static
int
cgfsng_set
(
struct
cgroup_ops
*
ops
,
const
char
*
value
,
const
char
*
name
,
const
char
*
lxcpath
)
const
char
*
filename
,
const
char
*
value
,
const
char
*
name
,
const
char
*
lxcpath
)
{
{
int
ret
=
-
1
;
int
ret
=
-
1
;
size_t
controller_len
;
size_t
controller_len
;
...
@@ -2238,8 +2244,9 @@ static bool __cg_unified_setup_limits(struct cgroup_ops *ops,
...
@@ -2238,8 +2244,9 @@ static bool __cg_unified_setup_limits(struct cgroup_ops *ops,
return
true
;
return
true
;
}
}
static
bool
cgfsng_setup_limits
(
struct
cgroup_ops
*
ops
,
struct
lxc_conf
*
conf
,
__cgfsng_ops__
static
bool
cgfsng_setup_limits
(
struct
cgroup_ops
*
ops
,
bool
do_devices
)
struct
lxc_conf
*
conf
,
bool
do_devices
)
{
{
bool
bret
;
bool
bret
;
...
@@ -2552,7 +2559,7 @@ static bool cg_init(struct cgroup_ops *ops)
...
@@ -2552,7 +2559,7 @@ static bool cg_init(struct cgroup_ops *ops)
return
cg_hybrid_init
(
ops
);
return
cg_hybrid_init
(
ops
);
}
}
static
bool
cgfsng_data_init
(
struct
cgroup_ops
*
ops
)
__cgfsng_ops__
static
bool
cgfsng_data_init
(
struct
cgroup_ops
*
ops
)
{
{
const
char
*
cgroup_pattern
;
const
char
*
cgroup_pattern
;
...
...
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