函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:vread() - read vmalloc area in a safe way.*@buf: buffer for reading data*@addr: vm address.*@count: number of bytes to be read.* This function checks that addr is a valid vmalloc'ed area, and* copy data from that area to a given buffer

函数原型:long vread(char *buf, char *addr, unsigned long count)

返回类型:long

参数:

类型参数名称
char *buf
char *addr
unsigned longcount
2919  buf_start等于buf
2920  buflen等于count
2924  如果addrcount小于countcount等于负addr
2927  加自旋锁
2929  如果非count退出
2932  如果非 in "busy" tree 则继续下一循环
2935  vm等于 in "busy" tree
2936  vaddr等于addr
2937  如果addr大于等于vaddrLowlevel-APIs (not for driver use!)则继续下一循环
2939 addr小于vaddr循环
2940  如果count恒等于0则转到:finished
2942  buf等于'\0'
2943  buf自加
2944  addr自加
2945  count自减
2947  n等于vaddrLowlevel-APIs (not for driver use!)addr
2948  如果n大于countn等于count
2950  如果非flags按位与remap() and friends 的值则small helper routine , copy contents to buf from addr.* If the page is not present, fill zero.
2952  否则memset(buf, 0, n)
2954  buf加等于n
2955  addr加等于n
2956  count减等于n
2958  finished :
2959  自旋锁解锁
2961  如果buf恒等于buf_start则返回:0
2964  如果buf不等于buf_startbuflenmemset(buf, 0, buflen - (buf - buf_start))
2967  返回:buflen