Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:z3fold_map() - maps the allocation associated with the given handle*@pool: pool in which the allocation resides*@handle: handle associated with the allocation to be mapped* Extracts the buddy number from handle and constructs the pointer to the

Proto:static void *z3fold_map(struct z3fold_pool *pool, unsigned long handle)

Type:void

Parameter:

TypeParameterName
struct z3fold_pool *pool
unsigned longhandle
1498  zhdr = rn locked z3fold page if it's not headless
1499  addr = zhdr
1500  page = virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr)
1502  If st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Go to out
1505  buddy = (handle & BUDDY_MASK) < zhdr->first_num is possible in encode_handle* but that doesn't matter. because the masking will result in the* correct buddy number.
1507  Case buddy == FIRST
1508  addr += ZHDR_SIZE_ALIGNED
1509  Break
1510  Case buddy == MIDDLE
1511  addr += start_middle << CHUNK_SHIFT
1512  Atomically set a bit in memory
1513  Break
1514  Case buddy == LAST
1515  addr += PAGE_SIZE - (ly for LAST bud, returns zero otherwise << CHUNK_SHIFT)
1516  Break
1517  Default
1518  pr_err("unknown buddy id %d\n", buddy)
1519  WARN_ON(1)
1520  addr = NULL
1521  Break
1524  If addr Then mapped_count++
1526  out :
1527  put_z3fold_header(zhdr)
1528  Return addr
Caller
NameDescribe
z3fold_zpool_map