Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\psi.c Create Date:2022-07-28 09:47:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:psi_write

Proto:static ssize_t psi_write(struct file *file, const char __user *user_buf, size_t nbytes, enum psi_res res)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *user_buf
size_tnbytes
enum psi_resres
1199  If static_branch_likely( & psi_disabled) Then Return -EOPNOTSUPP
1202  If Not nbytes Then Return -EINVAL
1205  buf_size = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(nbytes, size of buf )
1206  If copy_from_user(buf, user_buf, buf_size) Then Return -EFAULT
1209  buf[buf_size - 1] = '\0'
1211  new = psi_trigger_create( & psi_system, buf, nbytes, res)
1212  If IS_ERR(new) Then Return PTR_ERR(new)
1215  seq = needed for tty driver, and maybe others
1217  mutex_lock( & lock)
1218  psi_trigger_replace( & private, new)
1219  mutex_unlock( & lock)
1221  Return nbytes
Caller
NameDescribe
psi_io_write
psi_memory_write
psi_cpu_write