#include <linux/rculist.h>
#include <linux/list.h>
#include <linux/hash.h>
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/bpf.h>
#include <linux/bpf_local_storage.h>
#include <net/sock.h>
#include <uapi/linux/sock_diag.h>
#include <uapi/linux/btf.h>
#include <linux/bpf_lsm.h>
#include <linux/btf_ids.h>
#include <linux/fdtable.h>
#include <linux/rcupdate_trace.h>
DEFINE_BPF_STORAGE_CACHE(…);
static struct bpf_local_storage __rcu **
inode_storage_ptr(void *owner)
{ … }
static struct bpf_local_storage_data *inode_storage_lookup(struct inode *inode,
struct bpf_map *map,
bool cacheit_lockit)
{ … }
void bpf_inode_storage_free(struct inode *inode)
{ … }
static void *bpf_fd_inode_storage_lookup_elem(struct bpf_map *map, void *key)
{ … }
static long bpf_fd_inode_storage_update_elem(struct bpf_map *map, void *key,
void *value, u64 map_flags)
{ … }
static int inode_storage_delete(struct inode *inode, struct bpf_map *map)
{ … }
static long bpf_fd_inode_storage_delete_elem(struct bpf_map *map, void *key)
{ … }
BPF_CALL_5(bpf_inode_storage_get, struct bpf_map *, map, struct inode *, inode,
void *, value, u64, flags, gfp_t, gfp_flags)
{ … }
BPF_CALL_2(bpf_inode_storage_delete,
struct bpf_map *, map, struct inode *, inode)
{ … }
static int notsupp_get_next_key(struct bpf_map *map, void *key,
void *next_key)
{ … }
static struct bpf_map *inode_storage_map_alloc(union bpf_attr *attr)
{ … }
static void inode_storage_map_free(struct bpf_map *map)
{ … }
const struct bpf_map_ops inode_storage_map_ops = …;
BTF_ID_LIST_SINGLE(bpf_inode_storage_btf_ids, struct, inode)
const struct bpf_func_proto bpf_inode_storage_get_proto = …;
const struct bpf_func_proto bpf_inode_storage_delete_proto = …;