Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmalloc.c Create Date:2022-07-28 15:00:29
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:small helper routine , copy contents to buf from addr.* If the page is not present, fill zero.

Proto:static int aligned_vread(char *buf, char *addr, unsigned long count)

Type:int

Parameter:

TypeParameterName
char *buf
char *addr
unsigned longcount
2818  copied = 0
2820  When count cycle
2823  offset = offset_in_page(addr)
2824  length = PAGE_SIZE - offset
2825  If length > count Then length = count
2827  p = Walk a vmap address to the struct page it maps.
2835  If p Then
2840  map = kmap_atomic(p)
2843  Else memset(buf, 0, length)
2846  addr += length
2847  buf += length
2848  copied += length
2849  count -= length
2851  Return copied
Caller
NameDescribe
vreadvread() - 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