函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bpf_prog_realloc

函数原型:struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size, gfp_t gfp_extra_flags)

返回类型:struct bpf_prog

参数:

类型参数名称
struct bpf_prog *fp_old
unsigned intsize
gfp_tgfp_extra_flags
220  gfp_flags等于GFP_KERNEL按位或__GFP_ZERO按位或gfp_extra_flags
225  BUG_ON(fp_old == NULL)
227  size等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(size, PAGE_SIZE)
228  pages等于sizePAGE_SIZE
229  如果pages小于等于 Number of allocated pages 则返回:fp_old
232  delta等于pages Number of allocated pages
233  ret等于__bpf_prog_charge(user, delta)
234  如果ret则返回:NULL
237  fp等于__vmalloc(size, gfp_flags, PAGE_KERNEL)
238  如果(fp == NULL)则
239  __bpf_prog_uncharge(user, delta)
240  否则
241  内存复制(fp, fp_old, Number of allocated pages * PAGE_SIZE)
242  Number of allocated pages 等于pages
243  prog等于fp
248  Auxiliary fields = NULL
249  __bpf_prog_free(fp_old)
252  返回:fp
调用者
名称描述
bpf_patch_insn_single