#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",
};
#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);
};
#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);
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;
}
wait_for_completion(&fs->kobj_unregister);
}
-int btrfs_init_sysfs()
+int btrfs_init_sysfs(void)
{
btrfs_kset = kset_create_and_add("btrfs", NULL, fs_kobj);
if (!btrfs_kset)
return 0;
}
-void btrfs_exit_sysfs()
+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()
-{
- return 0;
-}
-
-void btrfs_exit_sysfs()
-{
- return;
-}
-#endif