From: Viktor Rosendahl Date: Thu, 11 Sep 2008 16:20:37 +0000 (+0300) Subject: lowmem: sysfs has changed X-Git-Tag: v2.6.27-omap1~202 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=49d948a13b7968e86f37b37d71e13ad8d6553abe;p=linux-2.6-omap-h63xx.git lowmem: sysfs has changed Currently, the lowmem module doesn't even compile because the kernel API has changed. This patch will unbreak the sysfs related code. Signed-off-by: Viktor Rosendahl Signed-off-by: Tony Lindgren --- diff --git a/security/lowmem.c b/security/lowmem.c index 183c57fb280..a5b6088fad7 100644 --- a/security/lowmem.c +++ b/security/lowmem.c @@ -117,16 +117,18 @@ static ctl_table lowmem_root_table[] = { }; #define KERNEL_ATTR_RO(_name) \ -static struct subsys_attribute _name##_attr = __ATTR_RO(_name) +static struct kobj_attribute _name##_attr = __ATTR_RO(_name) static int low_watermark_reached, high_watermark_reached; -static ssize_t low_watermark_show(struct subsystem *subsys, char *page) +static ssize_t low_watermark_show(struct kobject *kobj, + struct kobj_attribute *attr, char *page) { return sprintf(page, "%u\n", low_watermark_reached); } -static ssize_t high_watermark_show(struct subsystem *subsys, char *page) +static ssize_t high_watermark_show(struct kobject *kobj, + struct kobj_attribute *attr, char *page) { return sprintf(page, "%u\n", high_watermark_reached); } @@ -138,7 +140,7 @@ static void low_watermark_state(int new_state) { if (low_watermark_reached != new_state) { low_watermark_reached = new_state; - sysfs_notify(&kernel_subsys.kset.kobj, NULL, "low_watermark"); + sysfs_notify(kernel_kobj, NULL, "low_watermark"); } } @@ -146,7 +148,7 @@ static void high_watermark_state(int new_state) { if (high_watermark_reached != new_state) { high_watermark_reached = new_state; - sysfs_notify(&kernel_subsys.kset.kobj, NULL, "high_watermark"); + sysfs_notify(kernel_kobj, NULL, "high_watermark"); } } @@ -279,9 +281,7 @@ static int __init lowmem_init(void) if (unlikely(!lowmem_table_header)) return -EPERM; - kernel_subsys.kset.kobj.kset = &kernel_subsys.kset; - - r = sysfs_create_group(&kernel_subsys.kset.kobj, + r = sysfs_create_group(kernel_kobj, &lowmem_attr_group); if (unlikely(r)) return r; @@ -307,7 +307,7 @@ static void __exit lowmem_exit(void) unregister_sysctl_table(lowmem_table_header); - sysfs_remove_group(&kernel_subsys.kset.kobj, &lowmem_attr_group); + sysfs_remove_group(kernel_kobj, &lowmem_attr_group); printk(KERN_INFO MY_NAME ": Module removed.\n"); }