X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fksysfs.c;h=65daa5373ca6354afc0c575c1938ed1e9a08c300;hb=e87cb5db0dc357473ac71801051954ddd6ff604f;hp=2565e1b6dd7becc4def8504fd8b4cd65973a48b8;hpb=d638d4990bfb99998420e78e8fd4607bca5cf8d0;p=linux-2.6 diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index 2565e1b6dd..65daa5373c 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -14,6 +14,7 @@ #include #include #include +#include #define KERNEL_ATTR_RO(_name) \ static struct subsys_attribute _name##_attr = __ATTR_RO(_name) @@ -60,13 +61,22 @@ static ssize_t kexec_crash_loaded_show(struct kset *kset, char *page) return sprintf(page, "%d\n", !!kexec_crash_image); } KERNEL_ATTR_RO(kexec_crash_loaded); + +static ssize_t vmcoreinfo_show(struct kset *kset, char *page) +{ + return sprintf(page, "%lx %x\n", + paddr_vmcoreinfo_note(), + (unsigned int)vmcoreinfo_max_size); +} +KERNEL_ATTR_RO(vmcoreinfo); + #endif /* CONFIG_KEXEC */ /* * Make /sys/kernel/notes give the raw contents of our kernel .notes section. */ -extern const char __start_notes __attribute__((weak)); -extern const char __stop_notes __attribute__((weak)); +extern const void __start_notes __attribute__((weak)); +extern const void __stop_notes __attribute__((weak)); #define notes_size (&__stop_notes - &__start_notes) static ssize_t notes_read(struct kobject *kobj, struct bin_attribute *bin_attr, @@ -95,6 +105,7 @@ static struct attribute * kernel_attrs[] = { #ifdef CONFIG_KEXEC &kexec_loaded_attr.attr, &kexec_crash_loaded_attr.attr, + &vmcoreinfo_attr.attr, #endif NULL }; @@ -116,6 +127,13 @@ static int __init ksysfs_init(void) ¬es_attr); } + /* + * Create "/sys/kernel/uids" directory and corresponding root user's + * directory under it. + */ + if (!error) + error = uids_kobject_init(); + return error; }