Commit 1f00d375 authored by KP Singh's avatar KP Singh Committed by Alexei Starovoitov

bpf: Renames in preparation for bpf_local_storage

A purely mechanical change to split the renaming from the actual
generalization.

Flags/consts:

  SK_STORAGE_CREATE_FLAG_MASK	BPF_LOCAL_STORAGE_CREATE_FLAG_MASK
  BPF_SK_STORAGE_CACHE_SIZE	BPF_LOCAL_STORAGE_CACHE_SIZE
  MAX_VALUE_SIZE		BPF_LOCAL_STORAGE_MAX_VALUE_SIZE

Structs:

  bucket			bpf_local_storage_map_bucket
  bpf_sk_storage_map		bpf_local_storage_map
  bpf_sk_storage_data		bpf_local_storage_data
  bpf_sk_storage_elem		bpf_local_storage_elem
  bpf_sk_storage		bpf_local_storage

The "sk" member in bpf_local_storage is also updated to "owner"
in preparation for changing the type to void * in a subsequent patch.

Functions:

  selem_linked_to_sk			selem_linked_to_storage
  selem_alloc				bpf_selem_alloc
  __selem_unlink_sk			bpf_selem_unlink_storage_nolock
  __selem_link_sk			bpf_selem_link_storage_nolock
  selem_unlink_sk			__bpf_selem_unlink_storage
  sk_storage_update			bpf_local_storage_update
  __sk_storage_lookup			bpf_local_storage_lookup
  bpf_sk_storage_map_free		bpf_local_storage_map_free
  bpf_sk_storage_map_alloc		bpf_local_storage_map_alloc
  bpf_sk_storage_map_alloc_check	bpf_local_storage_map_alloc_check
  bpf_sk_storage_map_check_btf		bpf_local_storage_map_check_btf
Signed-off-by: default avatarKP Singh <kpsingh@google.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarMartin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20200825182919.1118197-2-kpsingh@chromium.org
parent 0fcdfffe
...@@ -246,7 +246,7 @@ struct sock_common { ...@@ -246,7 +246,7 @@ struct sock_common {
/* public: */ /* public: */
}; };
struct bpf_sk_storage; struct bpf_local_storage;
/** /**
* struct sock - network layer representation of sockets * struct sock - network layer representation of sockets
...@@ -517,7 +517,7 @@ struct sock { ...@@ -517,7 +517,7 @@ struct sock {
void (*sk_destruct)(struct sock *sk); void (*sk_destruct)(struct sock *sk);
struct sock_reuseport __rcu *sk_reuseport_cb; struct sock_reuseport __rcu *sk_reuseport_cb;
#ifdef CONFIG_BPF_SYSCALL #ifdef CONFIG_BPF_SYSCALL
struct bpf_sk_storage __rcu *sk_bpf_storage; struct bpf_local_storage __rcu *sk_bpf_storage;
#endif #endif
struct rcu_head sk_rcu; struct rcu_head sk_rcu;
}; };
......
This diff is collapsed.
...@@ -589,7 +589,7 @@ static inline int check_stack(void) ...@@ -589,7 +589,7 @@ static inline int check_stack(void)
return 1; return 1;
} }
struct bpf_sk_storage_map { struct bpf_local_storage_map {
struct bpf_map map; struct bpf_map map;
} __attribute__((preserve_access_index)); } __attribute__((preserve_access_index));
...@@ -602,8 +602,8 @@ struct { ...@@ -602,8 +602,8 @@ struct {
static inline int check_sk_storage(void) static inline int check_sk_storage(void)
{ {
struct bpf_sk_storage_map *sk_storage = struct bpf_local_storage_map *sk_storage =
(struct bpf_sk_storage_map *)&m_sk_storage; (struct bpf_local_storage_map *)&m_sk_storage;
struct bpf_map *map = (struct bpf_map *)&m_sk_storage; struct bpf_map *map = (struct bpf_map *)&m_sk_storage;
VERIFY(check(&sk_storage->map, map, sizeof(__u32), sizeof(__u32), 0)); VERIFY(check(&sk_storage->map, map, sizeof(__u32), sizeof(__u32), 0));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment