diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /kernel/ksysfs.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'kernel/ksysfs.c')
-rw-r--r-- | kernel/ksysfs.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 528dd78e7e7e..21fe3c426948 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -33,7 +33,7 @@ static ssize_t uevent_seqnum_show(struct kobject *kobj, | |||
33 | } | 33 | } |
34 | KERNEL_ATTR_RO(uevent_seqnum); | 34 | KERNEL_ATTR_RO(uevent_seqnum); |
35 | 35 | ||
36 | /* uevent helper program, used during early boo */ | 36 | /* uevent helper program, used during early boot */ |
37 | static ssize_t uevent_helper_show(struct kobject *kobj, | 37 | static ssize_t uevent_helper_show(struct kobject *kobj, |
38 | struct kobj_attribute *attr, char *buf) | 38 | struct kobj_attribute *attr, char *buf) |
39 | { | 39 | { |
@@ -100,6 +100,26 @@ static ssize_t kexec_crash_loaded_show(struct kobject *kobj, | |||
100 | } | 100 | } |
101 | KERNEL_ATTR_RO(kexec_crash_loaded); | 101 | KERNEL_ATTR_RO(kexec_crash_loaded); |
102 | 102 | ||
103 | static ssize_t kexec_crash_size_show(struct kobject *kobj, | ||
104 | struct kobj_attribute *attr, char *buf) | ||
105 | { | ||
106 | return sprintf(buf, "%zu\n", crash_get_memory_size()); | ||
107 | } | ||
108 | static ssize_t kexec_crash_size_store(struct kobject *kobj, | ||
109 | struct kobj_attribute *attr, | ||
110 | const char *buf, size_t count) | ||
111 | { | ||
112 | unsigned long cnt; | ||
113 | int ret; | ||
114 | |||
115 | if (strict_strtoul(buf, 0, &cnt)) | ||
116 | return -EINVAL; | ||
117 | |||
118 | ret = crash_shrink_memory(cnt); | ||
119 | return ret < 0 ? ret : count; | ||
120 | } | ||
121 | KERNEL_ATTR_RW(kexec_crash_size); | ||
122 | |||
103 | static ssize_t vmcoreinfo_show(struct kobject *kobj, | 123 | static ssize_t vmcoreinfo_show(struct kobject *kobj, |
104 | struct kobj_attribute *attr, char *buf) | 124 | struct kobj_attribute *attr, char *buf) |
105 | { | 125 | { |
@@ -147,6 +167,7 @@ static struct attribute * kernel_attrs[] = { | |||
147 | #ifdef CONFIG_KEXEC | 167 | #ifdef CONFIG_KEXEC |
148 | &kexec_loaded_attr.attr, | 168 | &kexec_loaded_attr.attr, |
149 | &kexec_crash_loaded_attr.attr, | 169 | &kexec_crash_loaded_attr.attr, |
170 | &kexec_crash_size_attr.attr, | ||
150 | &vmcoreinfo_attr.attr, | 171 | &vmcoreinfo_attr.attr, |
151 | #endif | 172 | #endif |
152 | NULL | 173 | NULL |
@@ -176,16 +197,8 @@ static int __init ksysfs_init(void) | |||
176 | goto group_exit; | 197 | goto group_exit; |
177 | } | 198 | } |
178 | 199 | ||
179 | /* create the /sys/kernel/uids/ directory */ | ||
180 | error = uids_sysfs_init(); | ||
181 | if (error) | ||
182 | goto notes_exit; | ||
183 | |||
184 | return 0; | 200 | return 0; |
185 | 201 | ||
186 | notes_exit: | ||
187 | if (notes_size > 0) | ||
188 | sysfs_remove_bin_file(kernel_kobj, ¬es_attr); | ||
189 | group_exit: | 202 | group_exit: |
190 | sysfs_remove_group(kernel_kobj, &kernel_attr_group); | 203 | sysfs_remove_group(kernel_kobj, &kernel_attr_group); |
191 | kset_exit: | 204 | kset_exit: |