summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorFeifei Xu <xufeifei@linux.vnet.ibm.com>2016-06-01 19:18:25 +0800
committerDavid Sterba <dsterba@suse.com>2016-06-02 19:23:14 +0200
commitb9ef22dedde08ab1b4ccd5f53344984c4dcb89f4 (patch)
tree82c6a1483dfdd040c1e0cdb7a9bfec06d351cd3a /fs/btrfs/super.c
parent0ef6447a3d2f014e49069c4da33f905ed803aa2a (diff)
downloadlinux-b9ef22dedde08ab1b4ccd5f53344984c4dcb89f4.tar.bz2
Btrfs: self-tests: Support non-4k page size
self-tests code assumes 4k as the sectorsize and nodesize. This commit fix hardcoded 4K. Enables the self-tests code to be executed on non-4k page sized systems (e.g. ppc64). Reviewed-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Feifei Xu <xufeifei@linux.vnet.ibm.com> Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 4e59a91a11e0..5b0b354ca594 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2319,27 +2319,31 @@ static void btrfs_print_mod_info(void)
static int btrfs_run_sanity_tests(void)
{
int ret;
+ u32 sectorsize, nodesize;
+ sectorsize = PAGE_SIZE;
+ nodesize = PAGE_SIZE;
ret = btrfs_init_test_fs();
if (ret)
return ret;
- ret = btrfs_test_free_space_cache();
+ ret = btrfs_test_free_space_cache(sectorsize, nodesize);
if (ret)
goto out;
- ret = btrfs_test_extent_buffer_operations();
+ ret = btrfs_test_extent_buffer_operations(sectorsize,
+ nodesize);
if (ret)
goto out;
- ret = btrfs_test_extent_io();
+ ret = btrfs_test_extent_io(sectorsize, nodesize);
if (ret)
goto out;
- ret = btrfs_test_inodes();
+ ret = btrfs_test_inodes(sectorsize, nodesize);
if (ret)
goto out;
- ret = btrfs_test_qgroups();
+ ret = btrfs_test_qgroups(sectorsize, nodesize);
if (ret)
goto out;
- ret = btrfs_test_free_space_tree();
+ ret = btrfs_test_free_space_tree(sectorsize, nodesize);
out:
btrfs_destroy_test_fs();
return ret;