Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\libfs.c Create Date:2022-07-28 20:10:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:simple_write_to_buffer - copy data from user space to the buffer*@to: the buffer to write to*@available: the size of the buffer*@ppos: the current position in the buffer*@from: the user space buffer to read from*@count: the maximum number of bytes to

Proto:ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, const void __user *from, size_t count)

Type:ssize_t

Parameter:

TypeParameterName
void *to
size_tavailable
loff_t *ppos
const void __user *from
size_tcount
683  pos = ppos
686  If pos < 0 Then Return -EINVAL
688  If pos >= available || Not count Then Return 0
690  If count > available - pos Then count = available - pos
692  res = copy_from_user(to + pos, from, count)
693  If res == count Then Return -EFAULT
695  count -= res
696  ppos = pos + count
697  Return count