[PATCH bpf-next 3/5] bpf: create a header for struct bpf_link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



struct bpf_link needs to be embedded by cgroups.
Put it in its own header.

Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
---
 include/linux/bpf-link.h | 23 +++++++++++++++++++++++
 include/linux/bpf.h      | 10 +---------
 2 files changed, 24 insertions(+), 9 deletions(-)
 create mode 100644 include/linux/bpf-link.h

diff --git a/include/linux/bpf-link.h b/include/linux/bpf-link.h
new file mode 100644
index 000000000000..d20f049af51a
--- /dev/null
+++ b/include/linux/bpf-link.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
+ */
+#ifndef _LINUX_BPF_MIN_H
+#define _LINUX_BPF_MIN_H 1
+
+#include <uapi/linux/bpf.h>
+
+#include <linux/workqueue.h>
+
+struct bpf_prog;
+struct bpf_link_ops;
+
+struct bpf_link {
+	atomic64_t refcnt;
+	u32 id;
+	enum bpf_link_type type;
+	const struct bpf_link_ops *ops;
+	struct bpf_prog *prog;
+	struct work_struct work;
+};
+
+#endif
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index b998347297ec..64bdae62a594 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -23,6 +23,7 @@
 #include <linux/slab.h>
 #include <linux/percpu-refcount.h>
 #include <linux/bpf-cgroup-types.h>
+#include <linux/bpf-link.h>
 #include <linux/bpfptr.h>
 
 struct bpf_verifier_env;
@@ -946,15 +947,6 @@ struct bpf_array_aux {
 	struct work_struct work;
 };
 
-struct bpf_link {
-	atomic64_t refcnt;
-	u32 id;
-	enum bpf_link_type type;
-	const struct bpf_link_ops *ops;
-	struct bpf_prog *prog;
-	struct work_struct work;
-};
-
 struct bpf_link_ops {
 	void (*release)(struct bpf_link *link);
 	void (*dealloc)(struct bpf_link *link);
-- 
2.31.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux