linux/kernel/bpf/bpf_cgrp_storage.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2022 Meta Platforms, Inc. and affiliates.
 */

#include <linux/types.h>
#include <linux/bpf.h>
#include <linux/bpf_local_storage.h>
#include <uapi/linux/btf.h>
#include <linux/btf_ids.h>

DEFINE_BPF_STORAGE_CACHE();

static DEFINE_PER_CPU(int, bpf_cgrp_storage_busy);

static void bpf_cgrp_storage_lock(void)
{}

static void bpf_cgrp_storage_unlock(void)
{}

static bool bpf_cgrp_storage_trylock(void)
{}

static struct bpf_local_storage __rcu **cgroup_storage_ptr(void *owner)
{}

void bpf_cgrp_storage_free(struct cgroup *cgroup)
{}

static struct bpf_local_storage_data *
cgroup_storage_lookup(struct cgroup *cgroup, struct bpf_map *map, bool cacheit_lockit)
{}

static void *bpf_cgrp_storage_lookup_elem(struct bpf_map *map, void *key)
{}

static long bpf_cgrp_storage_update_elem(struct bpf_map *map, void *key,
					 void *value, u64 map_flags)
{}

static int cgroup_storage_delete(struct cgroup *cgroup, struct bpf_map *map)
{}

static long bpf_cgrp_storage_delete_elem(struct bpf_map *map, void *key)
{}

static int notsupp_get_next_key(struct bpf_map *map, void *key, void *next_key)
{}

static struct bpf_map *cgroup_storage_map_alloc(union bpf_attr *attr)
{}

static void cgroup_storage_map_free(struct bpf_map *map)
{}

/* *gfp_flags* is a hidden argument provided by the verifier */
BPF_CALL_5(bpf_cgrp_storage_get, struct bpf_map *, map, struct cgroup *, cgroup,
	   void *, value, u64, flags, gfp_t, gfp_flags)
{}

BPF_CALL_2(bpf_cgrp_storage_delete, struct bpf_map *, map, struct cgroup *, cgroup)
{}

const struct bpf_map_ops cgrp_storage_map_ops =;

const struct bpf_func_proto bpf_cgrp_storage_get_proto =;

const struct bpf_func_proto bpf_cgrp_storage_delete_proto =;