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
bfe2971a
Unverified
Commit
bfe2971a
authored
Feb 02, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: remove unused conf argument
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
281c3645
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
21 deletions
+16
-21
cgfsng.c
src/lxc/cgroups/cgfsng.c
+6
-7
cgroup.h
src/lxc/cgroups/cgroup.h
+6
-10
lxccontainer.c
src/lxc/lxccontainer.c
+4
-4
No files found.
src/lxc/cgroups/cgfsng.c
View file @
bfe2971a
...
...
@@ -3496,14 +3496,13 @@ struct cgroup_ops *cgfsng_ops_init(struct lxc_conf *conf)
}
/* Connects to command socket therefore isn't callable from command handler. */
int
cgroup_get
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
cgroup_get
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
char
*
buf
,
size_t
len
)
{
__do_close
int
unified_fd
=
-
EBADF
;
ssize_t
ret
;
if
(
!
conf
||
is_empty_string
(
filename
)
||
is_empty_string
(
name
)
||
if
(
is_empty_string
(
filename
)
||
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
return
ret_errno
(
EINVAL
);
...
...
@@ -3522,13 +3521,13 @@ int cgroup_get(struct lxc_conf *conf,
}
/* Connects to command socket therefore isn't callable from command handler. */
int
cgroup_set
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
cgroup_set
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
const
char
*
value
)
{
__do_close
int
unified_fd
=
-
EBADF
;
ssize_t
ret
;
if
(
!
conf
||
is_empty_string
(
filename
)
||
is_empty_string
(
value
)
||
if
(
is_empty_string
(
filename
)
||
is_empty_string
(
value
)
||
is_empty_string
(
name
)
||
is_empty_string
(
lxcpath
))
return
ret_errno
(
EINVAL
);
...
...
@@ -3593,7 +3592,7 @@ static int __cgroup_freeze(int unified_fd,
return
log_trace
(
0
,
"Container now %s"
,
(
state_num
==
1
)
?
"frozen"
:
"unfrozen"
);
}
bool
cgroup_freeze
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
)
bool
cgroup_freeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
)
{
__do_close
int
unified_fd
=
-
EBADF
;
int
ret
;
...
...
@@ -3610,7 +3609,7 @@ bool cgroup_freeze(struct lxc_conf *conf, const char *name, const char *lxcpath,
return
ret
==
0
;
}
bool
cgroup_unfreeze
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
)
bool
cgroup_unfreeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
)
{
__do_close
int
unified_fd
=
-
EBADF
;
int
ret
;
...
...
src/lxc/cgroups/cgroup.h
View file @
bfe2971a
...
...
@@ -191,16 +191,12 @@ __hidden extern void prune_init_scope(char *cg);
__hidden
extern
int
cgroup_attach
(
const
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
pid_t
pid
);
__hidden
extern
int
cgroup_get
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
char
*
buf
,
size_t
len
);
__hidden
extern
int
cgroup_set
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
const
char
*
value
);
__hidden
extern
bool
cgroup_freeze
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
bool
cgroup_unfreeze
(
struct
lxc_conf
*
conf
,
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
int
cgroup_get
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
char
*
buf
,
size_t
len
);
__hidden
extern
int
cgroup_set
(
const
char
*
name
,
const
char
*
lxcpath
,
const
char
*
filename
,
const
char
*
value
);
__hidden
extern
bool
cgroup_freeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
__hidden
extern
bool
cgroup_unfreeze
(
const
char
*
name
,
const
char
*
lxcpath
,
int
timeout
);
static
inline
bool
pure_unified_layout
(
const
struct
cgroup_ops
*
ops
)
{
...
...
src/lxc/lxccontainer.c
View file @
bfe2971a
...
...
@@ -515,7 +515,7 @@ static bool do_lxcapi_freeze(struct lxc_container *c)
s
=
lxc_getstate
(
c
->
name
,
c
->
config_path
);
if
(
s
!=
FROZEN
)
{
bret
=
cgroup_freeze
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
,
-
1
);
bret
=
cgroup_freeze
(
c
->
name
,
c
->
config_path
,
-
1
);
if
(
!
bret
&&
errno
==
ENOCGROUP2
)
bret
=
lxc_freeze
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
);
}
...
...
@@ -535,7 +535,7 @@ static bool do_lxcapi_unfreeze(struct lxc_container *c)
s
=
lxc_getstate
(
c
->
name
,
c
->
config_path
);
if
(
s
==
FROZEN
)
{
bret
=
cgroup_unfreeze
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
,
-
1
);
bret
=
cgroup_unfreeze
(
c
->
name
,
c
->
config_path
,
-
1
);
if
(
!
bret
&&
errno
==
ENOCGROUP2
)
bret
=
lxc_unfreeze
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
);
}
...
...
@@ -3294,7 +3294,7 @@ static bool do_lxcapi_set_cgroup_item(struct lxc_container *c, const char *subsy
if
(
is_stopped
(
c
))
return
false
;
ret
=
cgroup_set
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
,
subsys
,
value
);
ret
=
cgroup_set
(
c
->
name
,
c
->
config_path
,
subsys
,
value
);
if
(
ret
==
ENOCGROUP2
)
{
cgroup_ops
=
cgroup_init
(
c
->
lxc_conf
);
if
(
!
cgroup_ops
)
...
...
@@ -3319,7 +3319,7 @@ static int do_lxcapi_get_cgroup_item(struct lxc_container *c, const char *subsys
if
(
is_stopped
(
c
))
return
-
1
;
ret
=
cgroup_get
(
c
->
lxc_conf
,
c
->
name
,
c
->
config_path
,
subsys
,
retv
,
inlen
);
ret
=
cgroup_get
(
c
->
name
,
c
->
config_path
,
subsys
,
retv
,
inlen
);
if
(
ret
==
ENOCGROUP2
)
{
cgroup_ops
=
cgroup_init
(
c
->
lxc_conf
);
if
(
!
cgroup_ops
)
...
...
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