Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\arraymap.c Create Date:2022-07-28 13:11:31
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ly called from syscall

Proto:int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file, void *key, void *value, u64 map_flags)

Type:int

Parameter:

TypeParameterName
struct bpf_map *map
struct file *map_file
void *key
void *value
u64map_flags
574  array = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(map, structbpf_array, map)
576  index = key
578  If map_flags != create new element or update existing Then Return -EINVAL
581  If index >= max_entries Then Return -E2BIG
584  ufd = value
585  new_ptr = map_fd_get_ptr(map, map_file, ufd)
586  If IS_ERR(new_ptr) Then Return PTR_ERR(new_ptr)
589  If map_poke_run Then
590  mutex_lock( & poke_mutex)
591  old_ptr = xchg(ptrs + index, new_ptr)
592  map_poke_run(map, index, old_ptr, new_ptr)
593  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
594  Else
595  old_ptr = xchg(ptrs + index, new_ptr)
598  If old_ptr Then map_fd_put_ptr(old_ptr)
600  Return 0
Caller
NameDescribe
map_update_elem