Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:disk_store

Proto:static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n)

Type:ssize_t

Parameter:

TypeParameterName
struct kobject *kobj
struct kobj_attribute *attr
const char *buf
size_tn
995  error = 0
999  mode = HIBERNATION_INVALID
1001  If Not hibernation_available() Then Return -EPERM
1004  p = memchr(buf, '\n', n)
1005  len = If p Then p - buf Else n
1007  lock_system_sleep()
1008  When i <= HIBERNATION_MAX cycle
1011  mode = i
1012  Break
1015  If mode != HIBERNATION_INVALID Then
1017  Case mode == HIBERNATION_SHUTDOWN
1018  Case mode == HIBERNATION_REBOOT
1022  Case mode == HIBERNATION_TEST_RESUME
1024  Break
1025  Case mode == HIBERNATION_PLATFORM
1028  Else error = -EINVAL
1031  Else error = -EINVAL
1034  If Not error Then pm_pr_dbg("Hibernation mode set to '%s'\n", hibernation_modes[mode])
1037  unlock_system_sleep()
1038  Return If error Then error Else n