Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
[pandora-kernel.git] / fs / btrfs / sysfs.c
index 61af5d8..a240b6f 100644 (file)
@@ -28,7 +28,6 @@
 #include "disk-io.h"
 #include "transaction.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)
 static ssize_t root_blocks_used_show(struct btrfs_root *root, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%llu\n",
@@ -68,7 +67,8 @@ struct btrfs_root_attr {
 };
 
 #define ROOT_ATTR(name, mode, show, store) \
-static struct btrfs_root_attr btrfs_root_attr_##name = __ATTR(name, mode, show, store)
+static struct btrfs_root_attr btrfs_root_attr_##name = __ATTR(name, mode, \
+                                                             show, store)
 
 ROOT_ATTR(blocks_used, 0444,   root_blocks_used_show,  NULL);
 ROOT_ATTR(block_limit, 0644,   root_block_limit_show,  NULL);
@@ -87,7 +87,8 @@ struct btrfs_super_attr {
 };
 
 #define SUPER_ATTR(name, mode, show, store) \
-static struct btrfs_super_attr btrfs_super_attr_##name = __ATTR(name, mode, show, store)
+static struct btrfs_super_attr btrfs_super_attr_##name = __ATTR(name, mode, \
+                                                               show, store)
 
 SUPER_ATTR(blocks_used,                0444,   super_blocks_used_show,         NULL);
 SUPER_ATTR(total_blocks,       0444,   super_total_blocks_show,        NULL);
@@ -213,14 +214,13 @@ int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
        fs->super_kobj.kset = btrfs_kset;
        error = kobject_init_and_add(&fs->super_kobj, &btrfs_super_ktype,
                                     NULL, "%s", name);
+       kfree(name);
        if (error)
                goto fail;
 
-       kfree(name);
        return 0;
 
 fail:
-       kfree(name);
        printk(KERN_ERR "btrfs: sysfs creation for super failed\n");
        return error;
 }
@@ -267,35 +267,3 @@ void btrfs_exit_sysfs(void)
        kset_unregister(btrfs_kset);
 }
 
-#else
-
-int btrfs_sysfs_add_super(struct btrfs_fs_info *fs)
-{
-       return 0;
-}
-
-int btrfs_sysfs_add_root(struct btrfs_root *root)
-{
-       return 0;
-}
-
-void btrfs_sysfs_del_root(struct btrfs_root *root)
-{
-       return;
-}
-
-void btrfs_sysfs_del_super(struct btrfs_fs_info *fs)
-{
-       return;
-}
-
-int btrfs_init_sysfs(void)
-{
-       return 0;
-}
-
-void btrfs_exit_sysfs(void)
-{
-       return;
-}
-#endif