diff options
author | Thomas Bertschinger <tahbertschinger@gmail.com> | 2024-01-15 23:41:02 -0700 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-16 01:47:05 -0500 |
commit | f5baaf48e3e82b1caf9f5cd1207d4d6feba3a2e5 (patch) | |
tree | 59f7b0e4667df7a9d3d5a45725f2aaab3e79b4c5 /c_src/raid/test.h | |
parent | fb35dbfdc5a9446fbb856dae5542b23963e28b89 (diff) |
move Rust sources to top level, C sources into c_src
This moves the Rust sources out of rust_src/ and into the top level.
Running the bcachefs executable out of the development tree is now:
$ ./target/release/bcachefs command
or
$ cargo run --profile release -- command
instead of "./bcachefs command".
Building and installing is still:
$ make && make install
Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'c_src/raid/test.h')
-rw-r--r-- | c_src/raid/test.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/c_src/raid/test.h b/c_src/raid/test.h new file mode 100644 index 00000000..6d902c7f --- /dev/null +++ b/c_src/raid/test.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2013 Andrea Mazzoleni + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __RAID_TEST_H +#define __RAID_TEST_H + +/** + * Tests insertion function. + * + * Test raid_insert() with all the possible combinations of elements to insert. + * + * Returns 0 on success. + */ +int raid_test_insert(void); + +/** + * Tests sorting function. + * + * Test raid_sort() with all the possible combinations of elements to sort. + * + * Returns 0 on success. + */ +int raid_test_sort(void); + +/** + * Tests combination functions. + * + * Tests combination_first() and combination_next() for all the parity levels. + * + * Returns 0 on success. + */ +int raid_test_combo(void); + +/** + * Tests recovering functions. + * + * All the recovering functions are tested with all the combinations + * of failing disks and recovering parities. + * + * Take care that the test time grows exponentially with the number of disks. + * + * Returns 0 on success. + */ +int raid_test_rec(unsigned mode, int nd, size_t size); + +/** + * Tests parity generation functions. + * + * All the parity generation functions are tested with the specified + * number of disks. + * + * Returns 0 on success. + */ +int raid_test_par(unsigned mode, int nd, size_t size); + +#endif + |