Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Encodes the handle of a particular buddy within a z3fold page* Pool lock should be held as this function accesses first_num

Proto:static unsigned long __encode_handle(struct z3fold_header *zhdr, struct z3fold_buddy_slots *slots, enum buddy bud)

Type:unsigned long

Parameter:

TypeParameterName
struct z3fold_header *zhdr
struct z3fold_buddy_slots *slots
enum buddybud
459  h = zhdr
460  idx = 0
466  If bud == HEADLESS Then Return h | 1 << PAGE_HEADLESS
470  idx = Helper function to build the index
471  h += idx
472  If bud == LAST Then h |= last_chunks << BUDDY_SHIFT
475  write_lock( & lock)
476  * we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[idx] = h
477  write_unlock( & lock)
478  Return (unsigned long) & * we are using BUDDY_MASK in handle_to_buddy etc. so there should * be enough slots to hold all possible variants[idx]
Caller
NameDescribe
encode_handle