函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\list_sort.c Create Date:2022-07-27 07:17:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:list_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

函数原型:__attribute__((nonnull(2, 3))) void list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, struct list_head *a, struct list_head *b))

返回类型:void

参数:

类型参数名称
void *priv
struct list_head *head
int (*cmp
192  struct list_head * list = 链表后项, * pending = NULL
193  count等于0
195  如果list恒等于链表前项则返回
199  链表后项 = NULL
219  循环
221  tail等于pending
224 bits按位与1循环tail等于链表前项
228  a等于tail, b等于prev
233  tail等于a
237  链表前项等于pending
238  pending等于list
239  list等于链表后项
240  链表后项 = NULL
241  count自加
242 list循环
245  list等于pending
246  pending等于链表前项
247  循环
248  next等于链表前项
250  如果非next退出
252  list等于Returns a list organized in an intermediate format suited* to chaining of merge() calls: null-terminated, no reserved or* sentinel head node, "prev" links not maintained.
253  pending等于next
256  Combine final list merge with restoration of standard doubly-linked* list structure
调用者
名称描述
list_sort_test
blk_mq_flush_plug_list
iomap_sort_ioends