]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
lowmem: sysfs has changed
authorViktor Rosendahl <viktor.rosendahl@nokia.com>
Thu, 11 Sep 2008 16:20:37 +0000 (19:20 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 12 Sep 2008 18:11:47 +0000 (11:11 -0700)
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 <viktor.rosendahl@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
security/lowmem.c

index 183c57fb280b14194f114f53fc290b5d77333868..a5b6088fad7bf978dfd59d02351a1a360a94173d 100644 (file)
@@ -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");
 }