Skip to content

Commit

Permalink
Btrfs: Disable sysfs files on older kernels
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
chrismason-xx committed Sep 25, 2008
1 parent 2e1a992 commit 55d4741
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions fs/btrfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#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",
Expand Down Expand Up @@ -265,3 +266,36 @@ void btrfs_exit_sysfs()
{
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

0 comments on commit 55d4741

Please sign in to comment.