Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:In the case that a entry with the same offset is found, a pointer to* the existing entry is stored in dupentry and the function returns -EEXIST

Proto:static int zswap_rb_insert(struct rb_root *root, struct zswap_entry *entry, struct zswap_entry **dupentry)

Type:int

Parameter:

TypeParameterName
struct rb_root *root
struct zswap_entry *entry
struct zswap_entry **dupentry
291  struct rb_node * * link = & rb_node, * parent = NULL
294  When link cycle
295  parent = link
296  myentry = rb_entry(parent, structzswap_entry, rbnode)
297  If the swap offset for the entry. Index into the red-black tree. > the swap offset for the entry. Index into the red-black tree. Then link = rb_left
299  Else if the swap offset for the entry. Index into the red-black tree. < the swap offset for the entry. Index into the red-black tree. Then link = rb_right
301  Else
302  dupentry = myentry
303  Return -EEXIST
306  rb_link_node( & links the entry into red-black tree for the appropriate swap type, parent, link)
307  rb_insert_color( & links the entry into red-black tree for the appropriate swap type, root)
308  Return 0
Caller
NameDescribe
zswap_frontswap_storeattempts to compress and store an single page