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
7af21d29
Unverified
Commit
7af21d29
authored
Jan 30, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
croups: improve __do_bpf_program_free
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dcbb9e99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
cgroup2_devices.h
src/lxc/cgroups/cgroup2_devices.h
+3
-14
No files found.
src/lxc/cgroups/cgroup2_devices.h
View file @
7af21d29
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "compiler.h"
#include "compiler.h"
#include "conf.h"
#include "conf.h"
#include "config.h"
#include "config.h"
#include "memory_utils.h"
#include "syscall_numbers.h"
#include "syscall_numbers.h"
#ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
#ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
...
@@ -65,14 +66,6 @@ __hidden extern void bpf_program_free(struct bpf_program *prog);
...
@@ -65,14 +66,6 @@ __hidden extern void bpf_program_free(struct bpf_program *prog);
__hidden
extern
void
bpf_device_program_free
(
struct
cgroup_ops
*
ops
);
__hidden
extern
void
bpf_device_program_free
(
struct
cgroup_ops
*
ops
);
__hidden
extern
bool
bpf_devices_cgroup_supported
(
void
);
__hidden
extern
bool
bpf_devices_cgroup_supported
(
void
);
static
inline
void
__auto_bpf_program_free__
(
struct
bpf_program
**
prog
)
{
if
(
*
prog
)
{
bpf_program_free
(
*
prog
);
*
prog
=
NULL
;
}
}
__hidden
extern
int
bpf_list_add_device
(
struct
lxc_conf
*
conf
,
struct
device_item
*
device
);
__hidden
extern
int
bpf_list_add_device
(
struct
lxc_conf
*
conf
,
struct
device_item
*
device
);
#else
/* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
#else
/* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
...
@@ -129,10 +122,6 @@ static inline bool bpf_devices_cgroup_supported(void)
...
@@ -129,10 +122,6 @@ static inline bool bpf_devices_cgroup_supported(void)
return
false
;
return
false
;
}
}
static
inline
void
__auto_bpf_program_free__
(
struct
bpf_program
**
prog
)
{
}
static
inline
int
bpf_list_add_device
(
struct
lxc_conf
*
conf
,
static
inline
int
bpf_list_add_device
(
struct
lxc_conf
*
conf
,
struct
device_item
*
device
)
struct
device_item
*
device
)
{
{
...
@@ -141,7 +130,7 @@ static inline int bpf_list_add_device(struct lxc_conf *conf,
...
@@ -141,7 +130,7 @@ static inline int bpf_list_add_device(struct lxc_conf *conf,
}
}
#endif
/* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
#endif
/* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
#define __do_bpf_program_free \
define_cleanup_function
(
struct
bpf_program
*
,
bpf_program_free
);
__attribute__((__cleanup__(__auto_bpf_program_free__))
)
#define __do_bpf_program_free call_cleaner(bpf_program_free
)
#endif
/* __LXC_CGROUP2_DEVICES_H */
#endif
/* __LXC_CGROUP2_DEVICES_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