Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:snapshot_read

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

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
char __user *buf
size_tcount
loff_t *offp
139  pg_offp = offp & ~PAGE_MASK
141  lock_system_sleep()
143  data = needed for tty driver, and maybe others
144  If Not ready Then
145  res = -ENODATA
146  Go to Unlock
148  If Not pg_offp Then
149  res = snapshot_read_next - Get the address to read the next image page from.*@handle: Snapshot handle to be used for the reading.* On the first call, @handle should point to a zeroed snapshot_handle* structure
150  If res <= 0 Then Go to Unlock
152  Else
153  res = PAGE_SIZE - pg_offp
156  res = simple_read_from_buffer(buf, count, & pg_offp, 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)
158  If res > 0 Then offp += res
161  Unlock :
162  unlock_system_sleep()
164  Return res