ksysfs.c (a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0) ksysfs.c (443cbaf9e2fdbef7d7cae457434a6cb8a679441b)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * kernel/ksysfs.c - sysfs attributes in /sys/kernel, which
4 * are not related to any other subsystem
5 *
6 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
7 */
8

--- 140 unchanged lines hidden (view full) ---

149
150 ret = crash_shrink_memory(cnt);
151 return ret < 0 ? ret : count;
152}
153KERNEL_ATTR_RW(kexec_crash_size);
154
155#endif /* CONFIG_KEXEC_CORE */
156
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * kernel/ksysfs.c - sysfs attributes in /sys/kernel, which
4 * are not related to any other subsystem
5 *
6 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
7 */
8

--- 140 unchanged lines hidden (view full) ---

149
150 ret = crash_shrink_memory(cnt);
151 return ret < 0 ? ret : count;
152}
153KERNEL_ATTR_RW(kexec_crash_size);
154
155#endif /* CONFIG_KEXEC_CORE */
156
157#ifdef CONFIG_CRASH_CORE
157#ifdef CONFIG_VMCORE_INFO
158
159static ssize_t vmcoreinfo_show(struct kobject *kobj,
160 struct kobj_attribute *attr, char *buf)
161{
162 phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
163 return sysfs_emit(buf, "%pa %x\n", &vmcore_base,
164 (unsigned int)VMCOREINFO_NOTE_SIZE);
165}

--- 6 unchanged lines hidden (view full) ---

172 unsigned int sz = crash_get_elfcorehdr_size();
173
174 return sysfs_emit(buf, "%u\n", sz);
175}
176KERNEL_ATTR_RO(crash_elfcorehdr_size);
177
178#endif
179
158
159static ssize_t vmcoreinfo_show(struct kobject *kobj,
160 struct kobj_attribute *attr, char *buf)
161{
162 phys_addr_t vmcore_base = paddr_vmcoreinfo_note();
163 return sysfs_emit(buf, "%pa %x\n", &vmcore_base,
164 (unsigned int)VMCOREINFO_NOTE_SIZE);
165}

--- 6 unchanged lines hidden (view full) ---

172 unsigned int sz = crash_get_elfcorehdr_size();
173
174 return sysfs_emit(buf, "%u\n", sz);
175}
176KERNEL_ATTR_RO(crash_elfcorehdr_size);
177
178#endif
179
180#endif /* CONFIG_CRASH_CORE */
180#endif /* CONFIG_VMCORE_INFO */
181
182/* whether file capabilities are enabled */
183static ssize_t fscaps_show(struct kobject *kobj,
184 struct kobj_attribute *attr, char *buf)
185{
186 return sysfs_emit(buf, "%d\n", file_caps_enabled);
187}
188KERNEL_ATTR_RO(fscaps);

--- 71 unchanged lines hidden (view full) ---

260#ifdef CONFIG_PROFILING
261 &profiling_attr.attr,
262#endif
263#ifdef CONFIG_KEXEC_CORE
264 &kexec_loaded_attr.attr,
265 &kexec_crash_loaded_attr.attr,
266 &kexec_crash_size_attr.attr,
267#endif
181
182/* whether file capabilities are enabled */
183static ssize_t fscaps_show(struct kobject *kobj,
184 struct kobj_attribute *attr, char *buf)
185{
186 return sysfs_emit(buf, "%d\n", file_caps_enabled);
187}
188KERNEL_ATTR_RO(fscaps);

--- 71 unchanged lines hidden (view full) ---

260#ifdef CONFIG_PROFILING
261 &profiling_attr.attr,
262#endif
263#ifdef CONFIG_KEXEC_CORE
264 &kexec_loaded_attr.attr,
265 &kexec_crash_loaded_attr.attr,
266 &kexec_crash_size_attr.attr,
267#endif
268#ifdef CONFIG_CRASH_CORE
268#ifdef CONFIG_VMCORE_INFO
269 &vmcoreinfo_attr.attr,
270#ifdef CONFIG_CRASH_HOTPLUG
271 &crash_elfcorehdr_size_attr.attr,
272#endif
273#endif
274#ifndef CONFIG_TINY_RCU
275 &rcu_expedited_attr.attr,
276 &rcu_normal_attr.attr,

--- 39 unchanged lines hidden ---
269 &vmcoreinfo_attr.attr,
270#ifdef CONFIG_CRASH_HOTPLUG
271 &crash_elfcorehdr_size_attr.attr,
272#endif
273#endif
274#ifndef CONFIG_TINY_RCU
275 &rcu_expedited_attr.attr,
276 &rcu_normal_attr.attr,

--- 39 unchanged lines hidden ---