函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\arraymap.c Create Date:2022-07-27 14:27:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ly called from syscall

函数原型:int bpf_fd_array_map_update_elem(struct bpf_map *map, struct file *map_file, void *key, void *value, u64 map_flags)

返回类型:int

参数:

类型参数名称
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  如果map_flags不等于create new element or update existing 则返回:负EINVAL
581  如果index大于等于max_entries则返回:负E2BIG
584  ufd等于value
585  new_ptr等于map_fd_get_ptr(map, map_file, ufd)
586  如果是错误则返回:错误
589  如果map_poke_run
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  否则
595  old_ptr等于xchg(ptrs + index, new_ptr)
598  如果old_ptrmap_fd_put_ptr(old_ptr)
600  返回:0
调用者
名称描述
map_update_elem