[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220602041028.95124-3-xiyou.wangcong@gmail.com>
Date: Wed, 1 Jun 2022 21:10:25 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: netdev@...r.kernel.org
Cc: bpf@...r.kernel.org, Cong Wang <cong.wang@...edance.com>
Subject: [RFC Patch v5 2/5] bpf: move map in map declarations to bpf.h
From: Cong Wang <cong.wang@...edance.com>
Signed-off-by: Cong Wang <cong.wang@...edance.com>
---
include/linux/bpf.h | 6 ++++++
kernel/bpf/arraymap.c | 2 --
kernel/bpf/hashtab.c | 1 -
kernel/bpf/map_in_map.c | 2 --
kernel/bpf/map_in_map.h | 19 -------------------
5 files changed, 6 insertions(+), 24 deletions(-)
delete mode 100644 kernel/bpf/map_in_map.h
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 8e6092d0ea95..cf04ddce2c2d 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -341,6 +341,12 @@ int map_check_no_btf(const struct bpf_map *map,
bool bpf_map_meta_equal(const struct bpf_map *meta0,
const struct bpf_map *meta1);
+struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
+void bpf_map_meta_free(struct bpf_map *map_meta);
+void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
+ int ufd);
+void bpf_map_fd_put_ptr(void *ptr);
+u32 bpf_map_fd_sys_lookup_elem(void *ptr);
extern const struct bpf_map_ops bpf_map_offload_ops;
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index fe40d3b9458f..65ba21e4b707 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -13,8 +13,6 @@
#include <linux/rcupdate_trace.h>
#include <linux/btf_ids.h>
-#include "map_in_map.h"
-
#define ARRAY_CREATE_FLAG_MASK \
(BPF_F_NUMA_NODE | BPF_F_MMAPABLE | BPF_F_ACCESS_MASK | \
BPF_F_PRESERVE_ELEMS | BPF_F_INNER_MAP)
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 17fb69c0e0dc..f0a2464c1669 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -13,7 +13,6 @@
#include <linux/btf_ids.h>
#include "percpu_freelist.h"
#include "bpf_lru_list.h"
-#include "map_in_map.h"
#define HTAB_CREATE_FLAG_MASK \
(BPF_F_NO_PREALLOC | BPF_F_NO_COMMON_LRU | BPF_F_NUMA_NODE | \
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index 135205d0d560..8a537f6b2abd 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -5,8 +5,6 @@
#include <linux/bpf.h>
#include <linux/btf.h>
-#include "map_in_map.h"
-
struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
{
struct bpf_map *inner_map, *inner_map_meta;
diff --git a/kernel/bpf/map_in_map.h b/kernel/bpf/map_in_map.h
deleted file mode 100644
index bcb7534afb3c..000000000000
--- a/kernel/bpf/map_in_map.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/* Copyright (c) 2017 Facebook
- */
-#ifndef __MAP_IN_MAP_H__
-#define __MAP_IN_MAP_H__
-
-#include <linux/types.h>
-
-struct file;
-struct bpf_map;
-
-struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
-void bpf_map_meta_free(struct bpf_map *map_meta);
-void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
- int ufd);
-void bpf_map_fd_put_ptr(void *ptr);
-u32 bpf_map_fd_sys_lookup_elem(void *ptr);
-
-#endif
--
2.34.1
Powered by blists - more mailing lists