Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lay_close - close the channel*@chan: the channel* Closes all channel buffers and frees the channel.

Proto:void relay_close(struct rchan *chan)

Type:void

Parameter:

TypeParameterName
struct rchan *chan
839  If Not chan Then Return
842  mutex_lock( & list of open channels, for cpu hotplug )
843  If One global buffer ? && (buf = per_cpu_ptr( per-cpu channel buffers , 0)) Then lay_close_buf - close a channel buffer*@buf: channel buffer* Marks the buffer finalized and restores the default callbacks.* The channel buffer and channel buffer data structure are then freed* automatically when the last reference is given up.
845  Else for_each_possible_cpu(i)
847  If buf = per_cpu_ptr( per-cpu channel buffers , i) Then lay_close_buf - close a channel buffer*@buf: channel buffer* Marks the buffer finalized and restores the default callbacks.* The channel buffer and channel buffer data structure are then freed* automatically when the last reference is given up.
850  If tried to log event > subbuf size Then printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
855  deletes entry from list
856  kref_put - decrement refcount for object.*@kref: object.*@release: pointer to the function that will clean up the object when the* last reference to the object is released.* This pointer is required, and it is not acceptable to pass kfree
857  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.