Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:vwrite() - write vmalloc area in a safe way.*@buf: buffer for source 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 a buffer to the given addr

Proto:long vwrite(char *buf, char *addr, unsigned long count)

Type:long

Parameter:

TypeParameterName
char *buf
char *addr
unsigned longcount
3000  copied = 0
3003  If addr + count < count Then count = -addr
3005  buflen = count
3007  spin_lock( & vmap_area_lock)
3009  If Not count Then Break
3012  If Not in "busy" tree Then Continue
3015  vm = in "busy" tree
3016  vaddr = addr
3017  If addr >= vaddr + Lowlevel-APIs (not for driver use!) Then Continue
3019  When addr < vaddr cycle
3020  If count == 0 Then Go to finished
3022  buf++
3023  addr++
3024  count--
3026  n = vaddr + Lowlevel-APIs (not for driver use!) - addr
3027  If n > count Then n = count
3029  If Not (flags & remap() and friends ) Then
3030  aligned_vwrite(buf, addr, n)
3031  copied++
3033  buf += n
3034  addr += n
3035  count -= n
3037  finished :
3038  spin_unlock( & vmap_area_lock)
3039  If Not copied Then Return 0
3041  Return buflen