Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:zs_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

Proto:void *zs_map_object(struct zs_pool *pool, unsigned long handle, enum zs_mapmode mm)

Type:void

Parameter:

TypeParameterName
struct zs_pool *pool
unsigned longhandle
enum zs_mapmodemm
1311  BUG_ON(in_interrupt())
1314  pin_tag(handle)
1316  obj = handle_to_obj(handle)
1317  bj_to_location - get (, ) from encoded object value*@obj: the encoded object value*@page: page object resides in zspage*@obj_idx: object index
1318  zspage = get_zspage(page)
1321  migrate_read_lock(zspage)
1323  get_zspage_mapping(zspage, & class_idx, & fg)
1324  class = size_class[class_idx]
1325  off = * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. * obj_idx & ~PAGE_MASK
1327  area = Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(per-cpu VM mapping areas for zspage accesses that cross page boundaries )
1328  mapping mode = mm
1329  If off + * Size of objects stored in this class. Must be multiple * of ZS_ALIGN. <= PAGE_SIZE Then
1331  address of kmap_atomic()'ed pages = kmap_atomic(page)
1332  ret = address of kmap_atomic()'ed pages + off
1333  Go to out
1337  pages[0] = page
1338  pages[1] = get_next_page(page)
1339  BUG_ON(!pages[1])
1341  ret = __zs_map_object(area, pages, off, * Size of objects stored in this class. Must be multiple * of ZS_ALIGN.)
1342  out :
1343  If Value is more likely to compile time(!PageHugeObject(page)) Then ret += ZS_HANDLE_SIZE
1346  Return ret
Caller
NameDescribe
zs_zpool_map