函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fsopen.c Create Date:2022-07-29 10:44:25
Last Modify:2022-05-24 07:35:12 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Allow the user to read back any error, warning or informational messages.

函数原型:static ssize_t fscontext_read(struct file *file, char __user *_buf, size_t len, loff_t *pos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char __user *_buf
size_tlen
loff_t *pos
27  fc等于 needed for tty driver, and maybe others
28  log等于log
29  logsize等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(buffer)
35  ret等于mutex_lock_interruptible( & uapi_mutex)
36  如果ret小于0则返回:ret
39  如果 Insertion index in buffer[] 恒等于 Removal index in buffer[]
40  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.
41  返回:负ENODATA
44  index等于 Removal index in buffer[] 按位与logsize减1
45  p等于buffer[index]
46  need_free等于 Mask of kfree'able items in buffer[] 按位与1左移index
47  buffer[index] = NULL
48  Mask of kfree'able items in buffer[] 与等于1左移index位的值的反
49  Removal index in buffer[] 自加
50  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.
52  ret等于负EMSGSIZE
53  n等于strlen - Find the length of a string*@s: The string to be sized
54  如果n大于len则转到:err_free
56  ret等于负EFAULT
57  如果copy_to_user(_buf, p, n)不等于0则转到:err_free
59  ret等于n
61  err_free :
62  如果need_free释放内存
64  返回:ret