Function report |
Source Code:kernel\bpf\hashtab.c |
Create Date:2022-07-28 13:09:59 |
| Last Modify:2022-05-23 09:15:29 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Called from syscall or from eBPF program
Proto:static int htab_map_update_elem(struct bpf_map *map, void *key, void *value, u64 map_flags)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct bpf_map * | map | |
| void * | key | |
| void * | value | |
| u64 | map_flags |
| 830 | If Value for the false possibility is greater at compile time((map_flags & ~spin_lock-ed map_lookup/map_update ) > update existing element ) Then Return -EINVAL |
| 834 | WARN_ON_ONCE(!_read_lock_held() - might we be in RCU read-side critical section?* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU* read-side critical section) |
| 838 | hash = htab_map_hash(key, key_size, hashrnd) |
| 840 | b = __select_bucket(htab, hash) |
| 844 | If Value for the false possibility is greater at compile time(!map_value_has_spin_lock(map)) Then Return -EINVAL |
| 847 | l_old = an be called without bucket lock. it will repeat the loop in* the unlikely event when elements moved from one bucket into another* while link list is being walked |
| 849 | ret = check_flags(htab, l_old, map_flags) |
| 852 | If l_old Then |
| 857 | Return 0 |
| 866 | raw_spin_lock_irqsave( & lock, flags) |
| 870 | ret = check_flags(htab, l_old, map_flags) |
| 884 | ret = 0 |
| 885 | Go to err |
| 900 | If l_old Then |
| 902 | If Not htab_is_prealloc(htab) Then free_htab_elem(htab, l_old) |
| 905 | ret = 0 |
| 906 | err : |
| 907 | raw_spin_unlock_irqrestore( & lock, flags) |
| 908 | Return ret |
| Name | Describe |
|---|---|
| bpf_fd_htab_map_update_elem | ly called from syscall |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |