Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__zs_map_object

Proto:static void *__zs_map_object(struct mapping_area *area, struct page *pages[2], int off, int size)

Type:void

Parameter:

TypeParameterName
struct mapping_area *area
struct page *pages
intoff
intsize
1181  buf = copy buffer for objects that span pages
1184  These routines enable/disable the pagefault handler. If disabled, it will* not take any locks and go straight to the fixup table.* User access methods will not sleep when called from a pagefault_disabled()* environment.
1187  If mapping mode == ZS_MM_WO Then Go to out
1190  sizes[0] = PAGE_SIZE - off
1191  sizes[1] = size - sizes[0]
1194  addr = kmap_atomic(pages[0])
1195  memcpy(buf, addr + off, sizes[0])
1196  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(addr)
1197  addr = kmap_atomic(pages[1])
1198  memcpy(buf + sizes[0], addr, sizes[1])
1199  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(addr)
1200  out :
1201  Return copy buffer for objects that span pages
Caller
NameDescribe
zs_map_objectzs_map_object - get address of allocated object from handle.*@pool: pool from which the object was allocated*@handle: handle returned from zs_malloc*@mm: maping mode to use* Before using an object allocated from zs_malloc, it must be mapped using