函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\ptr_ring.h Create Date:2022-07-27 14:41:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Note: producer lock is nested within consumer lock, so if you* resize you must make sure all uses nest correctly.* In particular if you consume ring in interrupt or BH context, you must* disable interrupts/BH when doing so.

函数原型:static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, unsigned int nrings, int size, gfp_t gfp, void (*destroy)(void *))

返回类型:int

参数:

类型参数名称
struct ptr_ring **rings
unsigned intnrings
intsize
gfp_tgfp
void (*destroy
627  queues等于分配数组内存
628  如果非queues则转到:noqueues
631 i小于nrings循环
632  queues[i]等于Not all gfp_t flags (besides GFP_KERNEL) are allowed. See* documentation for vmalloc for which of them are legal.
633  如果非queues[i]则转到:nomem
637 i小于nrings循环
638  spin_lock_irqsave( & consumer_lock, flags)
639  加自旋锁
640  queues[i]等于__ptr_ring_swap_queue(rings[i], queues[i], size, gfp, destroy)
642  自旋锁解锁
643  spin_unlock_irqrestore( & consumer_lock, flags)
646 i小于nrings循环kvfree(queues[i])
649  kfree(queues)
651  返回:0
653  nomem :
654 i先自减大于等于0循环
655  kvfree(queues[i])
657  kfree(queues)
659  noqueues :
660  返回:负ENOMEM