aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/ksysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/ksysfs.c')
-rw-r--r--kernel/ksysfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index d0e5c48e18c7..65daa5373ca6 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -14,6 +14,7 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/kexec.h> 16#include <linux/kexec.h>
17#include <linux/sched.h>
17 18
18#define KERNEL_ATTR_RO(_name) \ 19#define KERNEL_ATTR_RO(_name) \
19static struct subsys_attribute _name##_attr = __ATTR_RO(_name) 20static struct subsys_attribute _name##_attr = __ATTR_RO(_name)
@@ -60,6 +61,15 @@ static ssize_t kexec_crash_loaded_show(struct kset *kset, char *page)
60 return sprintf(page, "%d\n", !!kexec_crash_image); 61 return sprintf(page, "%d\n", !!kexec_crash_image);
61} 62}
62KERNEL_ATTR_RO(kexec_crash_loaded); 63KERNEL_ATTR_RO(kexec_crash_loaded);
64
65static ssize_t vmcoreinfo_show(struct kset *kset, char *page)
66{
67 return sprintf(page, "%lx %x\n",
68 paddr_vmcoreinfo_note(),
69 (unsigned int)vmcoreinfo_max_size);
70}
71KERNEL_ATTR_RO(vmcoreinfo);
72
63#endif /* CONFIG_KEXEC */ 73#endif /* CONFIG_KEXEC */
64 74
65/* 75/*
@@ -95,6 +105,7 @@ static struct attribute * kernel_attrs[] = {
95#ifdef CONFIG_KEXEC 105#ifdef CONFIG_KEXEC
96 &kexec_loaded_attr.attr, 106 &kexec_loaded_attr.attr,
97 &kexec_crash_loaded_attr.attr, 107 &kexec_crash_loaded_attr.attr,
108 &vmcoreinfo_attr.attr,
98#endif 109#endif
99 NULL 110 NULL
100}; 111};
@@ -116,6 +127,13 @@ static int __init ksysfs_init(void)
116 &notes_attr); 127 &notes_attr);
117 } 128 }
118 129
130 /*
131 * Create "/sys/kernel/uids" directory and corresponding root user's
132 * directory under it.
133 */
134 if (!error)
135 error = uids_kobject_init();
136
119 return error; 137 return error;
120} 138}
121 139