Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\relay.c Create Date:2022-07-28 11:46:47
Last Modify:2020-03-17 19:20:22 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lay_create_buf - allocate and initialize a channel buffer*@chan: the relay channel* Returns channel buffer if successful, %NULL otherwise.

Proto:static struct rchan_buf *relay_create_buf(struct rchan *chan)

Type:struct rchan_buf

Parameter:

TypeParameterName
struct rchan *chan
166  If number of sub-buffers per buffer > Maximum allocatable size / size of * Then Return NULL
169  buf = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
170  If Not buf Then Return NULL
172  padding counts per sub-buffer = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
174  If Not padding counts per sub-buffer Then Go to free_buf
177  start of channel buffer = lay_alloc_buf - allocate a channel buffer*@buf: the buffer struct*@size: total size of the buffer* Returns a pointer to the resulting buffer, %NULL if unsuccessful. The* passed in size will get page aligned, if it isn't already.
178  If Not start of channel buffer Then Go to free_buf
181  associated channel = chan
182  kref_get - increment refcount for object.*@kref: object.
183  Return buf
185  free_buf :
186  kfree(padding counts per sub-buffer )
187  kfree(buf)
188  Return NULL
Caller
NameDescribe
relay_open_buflay_open_buf - create a new relay channel buffer* used by relay_open() and CPU hotplug.