函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\user.c Create Date:2022-07-27 11:03:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:snapshot_open

函数原型:static int snapshot_open(struct inode *inode, struct file *filp)

返回类型:int

参数:

类型参数名称
struct inode *inode
struct file *filp
47  nr_calls等于0
49  如果非hibernation_available()则返回:负EPERM
52  lock_system_sleep()
54  如果非atomic_add_unless - add unless the number is already a given value*@v: pointer of type atomic_t*@a: the amount to add to v...*@u: ...unless v is equal to u.* Atomically adds @a to @v, if @v was not already @u.* Returns true if the addition was done.
55  error等于负EBUSY
56  转到:Unlock
59  如果f_flags按位与O_ACCMODE的值恒等于O_RDWR
60  atomic_inc( & snapshot_device_available)
61  error等于负ENOSYS
62  转到:Unlock
64  nonseekable_open(inode, filp)
65  data等于snapshot_state
66  needed for tty driver, and maybe others 等于data
67  memset( & handle, 0, sizeof(structsnapshot_handle))
68  如果f_flags按位与O_ACCMODE的值恒等于O_RDONLY
70  swap等于如果swsusp_resume_deviceswap_type_of(swsusp_resume_device, 0, NULL)否则负1
72  mode等于O_RDONLY
73  free_bitmaps = false
74  error等于__pm_notifier_call_chain(Going to hibernate , - 1, & nr_calls)
75  如果error__pm_notifier_call_chain(Hibernation finished , --nr_calls, NULL)
77  否则
82  wait_for_device_probe()
84  swap等于负1
85  mode等于O_WRONLY
86  error等于__pm_notifier_call_chain(Going to restore a saved image , - 1, & nr_calls)
87  如果非error
89  free_bitmaps等于非error
90  否则nr_calls自减
93  如果error__pm_notifier_call_chain(Restore failed , nr_calls, NULL)
96  如果erroratomic_inc( & snapshot_device_available)
99  frozen = false
100  ready = false
101  platform_support = false
103  Unlock :
104  unlock_system_sleep()
106  返回:error