Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Combine final list merge with restoration of standard doubly-linked* list structure

Proto:__attribute__((nonnull(2, 3, 4, 5))) static void merge_final(void *priv, cmp_func cmp, struct list_head *head, struct list_head *a, struct list_head *b)

Type:void

Parameter:

TypeParameterName
void *priv
cmp_funccmp
struct list_head *head
struct list_head *a
struct list_head *b
58  tail = head
59  count = 0
61  cycle
63  If cmp(priv, a, b) <= 0 Then
64  next = a
65  prev = tail
66  tail = a
67  a = next
68  If Not a Then Break
70  Else
71  next = b
72  prev = tail
73  tail = b
74  b = next
75  If Not b Then
76  b = a
77  Break
83  next = b
84  Do
92  If Value for the false possibility is greater at compile time(!++count) Then cmp(priv, b, b)
94  prev = tail
95  tail = b
96  b = next
97  When b cycle
100  next = head
101  prev = tail
Caller
NameDescribe
list_sortlist_sort - sort a list*@priv: private data, opaque to list_sort(), passed to @cmp*@head: the list to sort*@cmp: the elements comparison function* The comparison funtion @cmp must return > 0 if @a should sort after*@b ("@a > @b" if you want an ascending