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:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Return entries into ring

Proto:static inline void ptr_ring_unconsume(struct ptr_ring *r, void **batch, int n, void (*destroy)(void *))

Type:void

Parameter:

TypeParameterName
struct ptr_ring *r
void **batch
intn
void (*destroy
516  spin_lock_irqsave( & consumer_lock, flags)
517  spin_lock( & producer_lock)
519  If Not Read-only by both the producer and the consumer Then Go to done
526  head = consumer_head - 1
527  When Value is more likely to compile time(head >= next entry to invalidate ) cycle
528  queue[head--] = NULL
529  next entry to invalidate = consumer_head
535  When n cycle
536  head = consumer_head - 1
537  If head < 0 Then head = Read-only by both the producer and the consumer - 1
539  If queue[head] Then
541  Go to done
543  queue[head] = batch[--n]
544  next entry to invalidate = head
546  WRITE_ONCE(consumer_head, head)
549  done :
551  When n cycle
552  destroy(batch[--n])
553  spin_unlock( & producer_lock)
554  spin_unlock_irqrestore( & consumer_lock, flags)