]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
bpf: use __u32 not uint32_t
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 18 Feb 2021 10:36:32 +0000 (11:36 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 18 Feb 2021 10:54:32 +0000 (11:54 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgroup2_devices.c
src/lxc/cgroups/cgroup2_devices.h

index d9ef697e219541c7b3da50323efab44983552968..05ac85877c4d4d569ec68f40f17939957f6d2b55 100644 (file)
@@ -363,7 +363,7 @@ static int bpf_program_load_kernel(struct bpf_program *prog)
 }
 
 int bpf_program_cgroup_attach(struct bpf_program *prog, int type, int fd_cgroup,
-                             int replace_bpf_fd, uint32_t flags)
+                             int replace_bpf_fd, __u32 flags)
 {
        __do_close int fd_cgroup_dup = -EBADF;
        int ret;
index 130b73b3acc053f8feb1e7b6818838cd572d787a..e6302fb7cb8ac4393d6d3d80a95878a4ab0eafe5 100644 (file)
@@ -44,7 +44,7 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size)
 struct bpf_program {
        int device_list_type;
        int kernel_fd;
-       uint32_t prog_type;
+       __u32 prog_type;
 
        size_t n_instructions;
 #ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
@@ -53,7 +53,7 @@ struct bpf_program {
 
        int fd_cgroup;
        int attached_type;
-       uint32_t attached_flags;
+       __u32 attached_flags;
 };
 
 static inline bool bpf_device_block_all(const struct bpf_program *prog)
@@ -96,13 +96,14 @@ static inline void bpf_device_set_type(struct bpf_program *prog,
 }
 
 #ifdef HAVE_STRUCT_BPF_CGROUP_DEV_CTX
-__hidden extern struct bpf_program *bpf_program_new(uint32_t prog_type);
+__hidden extern struct bpf_program *bpf_program_new(__u32 prog_type);
 __hidden extern int bpf_program_init(struct bpf_program *prog);
 __hidden extern int bpf_program_append_device(struct bpf_program *prog, struct device_item *device);
 __hidden extern int bpf_program_finalize(struct bpf_program *prog);
-__hidden extern int bpf_program_cgroup_attach(struct bpf_program *prog, int type,
-                                             int fd_cgroup, int replace_bpf_fd,
-                                             uint32_t flags);
+__hidden extern int bpf_program_cgroup_attach(struct bpf_program *prog,
+                                             int type, int fd_cgroup,
+                                             __owns int replace_bpf_fd,
+                                             __u32 flags);
 __hidden extern int bpf_program_cgroup_detach(struct bpf_program *prog);
 __hidden extern void bpf_program_free(struct bpf_program *prog);
 __hidden extern void bpf_device_program_free(struct cgroup_ops *ops);
@@ -112,7 +113,7 @@ __hidden extern int bpf_list_add_device(struct lxc_conf *conf, struct device_ite
 
 #else /* !HAVE_STRUCT_BPF_CGROUP_DEV_CTX */
 
-static inline struct bpf_program *bpf_program_new(uint32_t prog_type)
+static inline struct bpf_program *bpf_program_new(__u32 prog_type)
 {
        return ret_set_errno(NULL, ENOSYS);
 }
@@ -136,7 +137,7 @@ static inline int bpf_program_finalize(struct bpf_program *prog)
 
 static inline int bpf_program_cgroup_attach(struct bpf_program *prog, int type,
                                            int fd_cgroup, int replace_bpf_fd,
-                                           uint32_t flags)
+                                           __u32 flags)
 {
        return ret_errno(ENOSYS);
 }