Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:include\linux\ptr_ring.h Create Date:2022-07-28 13:23:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static inline int ptr_ring_resize_multiple(struct ptr_ring **rings, unsigned int nrings, int size, gfp_t gfp, void (*destroy)(void *))

Type:int

Parameter:

TypeParameterName
struct ptr_ring **rings
unsigned intnrings
intsize
gfp_tgfp
void (*destroy
627  queues = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
628  If Not queues Then Go to noqueues
631  When i < nrings cycle
632  queues[i] = Not all gfp_t flags (besides GFP_KERNEL) are allowed. See* documentation for vmalloc for which of them are legal.
633  If Not queues[i] Then Go to nomem
637  When i < nrings cycle
638  spin_lock_irqsave( & consumer_lock, flags)
639  spin_lock( & producer_lock)
640  queues[i] = __ptr_ring_swap_queue(rings[i], queues[i], size, gfp, destroy)
642  spin_unlock( & producer_lock)
643  spin_unlock_irqrestore( & consumer_lock, flags)
646  When i < nrings cycle kvfree(queues[i])
649  kfree(queues)
651  Return 0
653  nomem :
654  When --i >= 0 cycle
655  kvfree(queues[i])
657  kfree(queues)
659  noqueues :
660  Return -ENOMEM