Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:snapshot_write

Proto:static ssize_t snapshot_write(struct file *filp, const char __user *buf, size_t count, loff_t *offp)

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
const char __user *buf
size_tcount
loff_t *offp
172  pg_offp = offp & ~PAGE_MASK
174  lock_system_sleep()
176  data = needed for tty driver, and maybe others
178  If Not pg_offp Then
179  res = snapshot_write_next - Get the address to store the next image page.*@handle: Snapshot handle structure to guide the writing.* On the first call, @handle should point to a zeroed snapshot_handle* structure
180  If res <= 0 Then Go to unlock
182  Else
183  res = PAGE_SIZE - pg_offp
186  If Not This macro returns the address from/to which the caller of* snapshot_read_next()/snapshot_write_next() is allowed to* read/write data after the function returns(handle) Then
187  res = -EINVAL
188  Go to unlock
191  res = simple_write_to_buffer(This macro returns the address from/to which the caller of* snapshot_read_next()/snapshot_write_next() is allowed to* read/write data after the function returns(handle), res, & pg_offp, buf, count)
193  If res > 0 Then offp += res
195  unlock :
196  unlock_system_sleep()
198  Return res