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:19
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(struct ptr_ring *r, int size, gfp_t gfp, void (*destroy)(void *))

Type:int

Parameter:

TypeParameterName
struct ptr_ring *r
intsize
gfp_tgfp
void (*destroy
593  queue = Not all gfp_t flags (besides GFP_KERNEL) are allowed. See* documentation for vmalloc for which of them are legal.
596  If Not queue Then Return -ENOMEM
599  spin_lock_irqsave( & consumer_lock, flags)
600  spin_lock( & producer_lock)
602  old = __ptr_ring_swap_queue(r, queue, size, gfp, destroy)
604  spin_unlock( & producer_lock)
605  spin_unlock_irqrestore( & consumer_lock, flags)
607  kvfree(old)
609  Return 0