Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:snapshot_compat_ioctl

Proto:static long snapshot_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

Type:long

Parameter:

TypeParameterName
struct file *file
unsigned intcmd
unsigned longarg
407  BUILD_BUG_ON - break compile if a condition is true(sizeof(loff_t) != sizeof(compat_loff_t))
410  Case cmd == SNAPSHOT_GET_IMAGE_SIZE
411  Case cmd == SNAPSHOT_AVAIL_SWAP_SIZE
412  Case cmd == SNAPSHOT_ALLOC_SWAP_PAGE
413  __user * uoffset = A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
418  old_fs = get_fs()
419  set_fs(KERNEL_DS)
420  err = snapshot_ioctl(file, cmd, (unsignedlong) & offset)
421  set_fs(old_fs)
422  If Not err && Write a simple value into user space(offset, uoffset) Then err = -EFAULT
424  Return err
427  Case cmd == SNAPSHOT_CREATE_IMAGE
428  Return snapshot_ioctl(file, cmd, (unsignedlong)A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.)
431  Case cmd == SNAPSHOT_SET_SWAP_AREA
432  __user * u_swap_area = A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
438  err = Get a simple variable from user space(offset, & offset)
439  err |= Get a simple variable from user space(dev, & dev)
440  If err Then Return -EFAULT
442  old_fs = get_fs()
443  set_fs(KERNEL_DS)
444  err = snapshot_ioctl(file, SNAPSHOT_SET_SWAP_AREA, (unsignedlong) & swap_area)
446  set_fs(old_fs)
447  Return err
450  Default
451  Return snapshot_ioctl(file, cmd, arg)