btrfs-tests.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2013 Fusion IO. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License v2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. * General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public
  14. * License along with this program; if not, write to the
  15. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. * Boston, MA 021110-1307, USA.
  17. */
  18. #ifndef __BTRFS_TESTS
  19. #define __BTRFS_TESTS
  20. #ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
  21. #define test_msg(fmt, ...) pr_info("BTRFS: selftest: " fmt, ##__VA_ARGS__)
  22. struct btrfs_root;
  23. struct btrfs_trans_handle;
  24. int btrfs_test_free_space_cache(void);
  25. int btrfs_test_extent_buffer_operations(void);
  26. int btrfs_test_extent_io(void);
  27. int btrfs_test_inodes(void);
  28. int btrfs_test_qgroups(void);
  29. int btrfs_test_free_space_tree(void);
  30. int btrfs_init_test_fs(void);
  31. void btrfs_destroy_test_fs(void);
  32. struct inode *btrfs_new_test_inode(void);
  33. struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(void);
  34. void btrfs_free_dummy_root(struct btrfs_root *root);
  35. struct btrfs_block_group_cache *
  36. btrfs_alloc_dummy_block_group(unsigned long length);
  37. void btrfs_free_dummy_block_group(struct btrfs_block_group_cache *cache);
  38. void btrfs_init_dummy_trans(struct btrfs_trans_handle *trans);
  39. #else
  40. static inline int btrfs_test_free_space_cache(void)
  41. {
  42. return 0;
  43. }
  44. static inline int btrfs_test_extent_buffer_operations(void)
  45. {
  46. return 0;
  47. }
  48. static inline int btrfs_init_test_fs(void)
  49. {
  50. return 0;
  51. }
  52. static inline void btrfs_destroy_test_fs(void)
  53. {
  54. }
  55. static inline int btrfs_test_extent_io(void)
  56. {
  57. return 0;
  58. }
  59. static inline int btrfs_test_inodes(void)
  60. {
  61. return 0;
  62. }
  63. static inline int btrfs_test_qgroups(void)
  64. {
  65. return 0;
  66. }
  67. static inline int btrfs_test_free_space_tree(void)
  68. {
  69. return 0;
  70. }
  71. #endif
  72. #endif