diff --git a/.gitignore b/.gitignore index 3b1de6a4..b07cb58e 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,5 @@ contrib/ paper/ kernel/ obj/ +bench/ diff --git a/Makefile.am b/Makefile.am index c2556c8b..3145b85e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,107 +2,115 @@ bin_PROGRAMS = snapraid check_PROGRAMS = mktest snapraid_SOURCES = \ - raid/raid.c \ - raid/module.c \ - raid/tables.c \ - raid/int.c \ - raid/x86.c \ - raid/intz.c \ - raid/x86z.c \ - raid/helper.c \ - raid/memory.c \ - raid/test.c \ - raid/tag.c \ - snapraid.c \ - tommy.c \ - util.c \ - elem.c \ - state.c \ - scan.c \ - sync.c \ - check.c \ - dry.c \ - rehash.c \ - scrub.c \ - status.c \ - dup.c \ - list.c \ - pool.c \ - parity.c \ - handle.c \ - fnmatch.c \ - selftest.c \ - speed.c \ - import.c \ - mingw.c \ - unix.c + src/raid/raid.c \ + src/raid/module.c \ + src/raid/tables.c \ + src/raid/int.c \ + src/raid/x86.c \ + src/raid/intz.c \ + src/raid/x86z.c \ + src/raid/helper.c \ + src/raid/memory.c \ + src/raid/test.c \ + src/raid/tag.c \ + src/tommyds/tommy.c \ + src/snapraid.c \ + src/util.c \ + src/elem.c \ + src/state.c \ + src/scan.c \ + src/sync.c \ + src/check.c \ + src/dry.c \ + src/rehash.c \ + src/scrub.c \ + src/status.c \ + src/dup.c \ + src/list.c \ + src/pool.c \ + src/parity.c \ + src/handle.c \ + src/fnmatch.c \ + src/selftest.c \ + src/speed.c \ + src/import.c \ + src/mingw.c \ + src/unix.c noinst_HEADERS = \ - raid/raid.h \ - raid/helper.h \ - raid/internal.h \ - raid/cpu.h \ - raid/gf.h \ - raid/combo.h \ - raid/memory.h \ - raid/test.h \ - portable.h \ - snapraid.h \ - util.h \ - elem.h \ - state.h \ - parity.h \ - handle.h \ - murmur3.c \ - murmur3test.c \ - spooky2.c \ - spooky2test.c \ - tommyarray.h \ - tommyarrayblk.h \ - tommyarrayblkof.h \ - tommychain.h \ - tommyhash.h \ - tommyhashdyn.h \ - tommylist.h \ - tommytypes.h \ - tommyarray.c \ - tommyarrayblk.c \ - tommyarrayblkof.c \ - tommyhash.c \ - tommyhashdyn.c \ - tommylist.c \ - fnmatch.h \ - import.h \ - mingw.h \ - unix.h + src/raid/raid.h \ + src/raid/helper.h \ + src/raid/internal.h \ + src/raid/cpu.h \ + src/raid/gf.h \ + src/raid/combo.h \ + src/raid/memory.h \ + src/raid/test.h \ + src/tommyds/tommyarray.h \ + src/tommyds/tommyarrayblk.h \ + src/tommyds/tommyarrayblkof.h \ + src/tommyds/tommychain.h \ + src/tommyds/tommyhash.h \ + src/tommyds/tommyhashdyn.h \ + src/tommyds/tommylist.h \ + src/tommyds/tommytypes.h \ + src/tommyds/tommyarray.c \ + src/tommyds/tommyarrayblk.c \ + src/tommyds/tommyarrayblkof.c \ + src/tommyds/tommyhash.c \ + src/tommyds/tommyhashdyn.c \ + src/tommyds/tommylist.c \ + src/portable.h \ + src/snapraid.h \ + src/util.h \ + src/elem.h \ + src/state.h \ + src/parity.h \ + src/handle.h \ + src/murmur3.c \ + src/murmur3test.c \ + src/spooky2.c \ + src/spooky2test.c \ + src/fnmatch.h \ + src/import.h \ + src/mingw.h \ + src/unix.h mktest_SOURCES = \ - mktest.c \ - mingw.c + src/mktest.c \ + src/mingw.c EXTRA_DIST = \ autogen.sh \ README AUTHORS HISTORY INSTALL COPYING TODO TEST INSTALL.windows \ snapraid.d snapraid.1 snapraid.txt \ - test-par1.conf test-par2.conf test-par3.conf test-par4.conf test-par5.conf test-par6.conf test-par6-hole.conf \ + test/test-par1.conf \ + test/test-par2.conf \ + test/test-par3.conf \ + test/test-par4.conf \ + test/test-par5.conf \ + test/test-par6.conf \ + test/test-par6-hole.conf \ snapraid.conf.example \ configure.windows-x86 configure.windows-x64 snapraid.conf.example.windows \ acinclude.m4 \ - raid/COPYING \ - raid/test/Makefile \ - raid/test/fulltest.c \ - raid/test/selftest.c \ - raid/test/speedtest.c \ - raid/test/invtest.c + src/tommyds/LICENSE \ + src/raid/COPYING \ + src/raid/test/Makefile \ + src/raid/test/fulltest.c \ + src/raid/test/selftest.c \ + src/raid/test/speedtest.c \ + src/raid/test/invtest.c man_MANS = snapraid.1 clean-local: rm -f valgrind.log callgrind.log cachegrind.log - rm -rf test + rm -rf bench rm -f test*.log output.log - rm -f *.gcda *.gcno *.gcov - rm -f raid/*.gcda raid/*.gcno raid/*.gcov + rm -f src/*.gcda src/*.gcno src/*.gcov + rm -f src/raid/*.gcda src/raid/*.gcno src/raid/*.gcov + rm -f src/tommyds/*.gcda src/tommyds/*.gcno src/tommyds/*.gcov rm -rf cov rm -f lcov.info rm -f gmon.out @@ -117,26 +125,26 @@ CHECKFLAGS_VERBOSE = $(CHECKFLAGS_BASE) -v -G CHECKFLAGS = $(CHECKFLAGS_BASE) -q CHECKCOUNT = 1000 CHECKSIZE = 4000 -CONF = $(srcdir)/test-par6.conf -HOLE = $(srcdir)/test-par6-hole.conf -PAR1 = $(srcdir)/test-par1.conf -PAR2 = $(srcdir)/test-par2.conf -PAR3 = $(srcdir)/test-par3.conf -PAR4 = $(srcdir)/test-par4.conf -PAR5 = $(srcdir)/test-par5.conf -PAR6 = $(srcdir)/test-par6.conf +CONF = $(srcdir)/test/test-par6.conf +HOLE = $(srcdir)/test/test-par6-hole.conf +PAR1 = $(srcdir)/test/test-par1.conf +PAR2 = $(srcdir)/test/test-par2.conf +PAR3 = $(srcdir)/test/test-par3.conf +PAR4 = $(srcdir)/test/test-par4.conf +PAR5 = $(srcdir)/test/test-par5.conf +PAR6 = $(srcdir)/test/test-par6.conf check-local: - rm -rf test + rm -rf bench rm -f test.log - mkdir test - mkdir test/disk1 - mkdir test/disk2 - mkdir test/disk3 - mkdir test/disk4 - mkdir test/disk5 - mkdir test/disk6 - mkdir test/pool + mkdir bench + mkdir bench/disk1 + mkdir bench/disk2 + mkdir bench/disk3 + mkdir bench/disk4 + mkdir bench/disk5 + mkdir bench/disk6 + mkdir bench/pool echo --- Help $(TESTENV) ./snapraid$(EXEEXT) --test-skip-device -H $(TESTENV) ./snapraid$(EXEEXT) --test-skip-device -V @@ -162,8 +170,8 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -a check echo --- Create some files, sync and check $(TESTENV) ./mktest$(EXEEXT) generate 1 6 $(CHECKCOUNT) $(CHECKSIZE) - echo DUP > test/disk1/DUP1 - echo DUP > test/disk1/DUP2 + echo DUP > bench/disk1/DUP1 + echo DUP > bench/disk1/DUP2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) -c $(CONF) diff > output.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-force-order-physical sync echo --- Some commands with a not empty array @@ -177,43 +185,43 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -a check echo --- Check the --gen-conf command - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --gen-conf test/content + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --gen-conf bench/content echo --- Filter $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -d disk1 check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) -c $(CONF) -f "*a" -f "a/" -f "/b/a*" check echo --- Delete some files and sync - rm test/disk4/a/9* - rm test/disk5/a/9* - rm test/disk6/a/9* + rm bench/disk4/a/9* + rm bench/disk5/a/9* + rm bench/disk6/a/9* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) -c $(CONF) diff > output.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Move some files, sync and check - mv test/disk1/a/9* test/disk4/a - mv test/disk2/a/9* test/disk5/a - mv test/disk3/a/9* test/disk6/a + mv bench/disk1/a/9* bench/disk4/a + mv bench/disk2/a/9* bench/disk5/a + mv bench/disk3/a/9* bench/disk6/a $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) -c $(CONF) diff > output.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Create some more files, hardlinks and empty directories, delete others, sync PAR1 and check - rm test/disk4/a/8* - rm test/disk5/a/8* - rm test/disk6/a/8* + rm bench/disk4/a/8* + rm bench/disk5/a/8* + rm bench/disk6/a/8* $(TESTENV) ./mktest$(EXEEXT) generate 2 6 $(CHECKCOUNT) $(CHECKSIZE) - mkdir test/disk1/empty1 - mkdir test/disk2/empty2 - mkdir test/disk3/empty3a - mkdir test/disk3/empty3a/emptyinner - mkdir test/disk3/empty3b - echo 1 > test/disk1/file_hardlink1 - ln test/disk1/file_hardlink1 test/disk1/file_hardlink2 - ln test/disk1/file_hardlink1 test/disk1/file_hardlink3 - echo 2 > test/disk2/file_hardlink1 - ln test/disk2/file_hardlink1 test/disk2/file_hardlink2 - ln test/disk2/file_hardlink1 test/disk2/file_hardlink3 - echo 3 > test/disk3/file_hardlink1 - ln test/disk3/file_hardlink1 test/disk3/file_hardlink2 - ln test/disk3/file_hardlink1 test/disk3/file_hardlink3 + mkdir bench/disk1/empty1 + mkdir bench/disk2/empty2 + mkdir bench/disk3/empty3a + mkdir bench/disk3/empty3a/emptyinner + mkdir bench/disk3/empty3b + echo 1 > bench/disk1/file_hardlink1 + ln bench/disk1/file_hardlink1 bench/disk1/file_hardlink2 + ln bench/disk1/file_hardlink1 bench/disk1/file_hardlink3 + echo 2 > bench/disk2/file_hardlink1 + ln bench/disk2/file_hardlink1 bench/disk2/file_hardlink2 + ln bench/disk2/file_hardlink1 bench/disk2/file_hardlink3 + echo 3 > bench/disk3/file_hardlink1 + ln bench/disk3/file_hardlink1 bench/disk3/file_hardlink2 + ln bench/disk3/file_hardlink1 bench/disk3/file_hardlink3 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) -c $(PAR1) diff > output.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-fallocate -c $(PAR1) --test-force-order-inode sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status @@ -240,7 +248,7 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status echo --- Silently corrupt some files, scrub and fix filtering for error $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - $(TESTENV) ./mktest$(EXEEXT) damage 1 10 1 test/disk1/a/* + $(TESTENV) ./mktest$(EXEEXT) damage 1 10 1 bench/disk1/a/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-expect-recoverable --test-force-scrub 100000 scrub $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) fix -e @@ -249,142 +257,142 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -p 100 scrub $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Silently corrupt some files, and sync with error presents - $(TESTENV) ./mktest$(EXEEXT) change 1 500 test/disk1/a/* - $(TESTENV) ./mktest$(EXEEXT) damage 1 1 500 test/disk2/a/* + $(TESTENV) ./mktest$(EXEEXT) change 1 500 bench/disk1/a/* + $(TESTENV) ./mktest$(EXEEXT) damage 1 1 500 bench/disk2/a/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-expect-recoverable sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) fix -e echo --- Make a hole in the disk array and sync with --force-empty - mv test/disk2 test/disk2.old - mkdir test/disk2 + mv bench/disk2 bench/disk2.old + mkdir bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --force-empty sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Use with the hole $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(HOLE) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(HOLE) check - rm -r test/disk1/a - rm -r test/disk3/a + rm -r bench/disk1/a + rm -r bench/disk3/a $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(HOLE) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(HOLE) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(HOLE) test-dry echo --- Fill the hole with a new disk - rm -r test/disk2 - mv test/disk2.old test/disk2 + rm -r bench/disk2 + mv bench/disk2.old bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt the content file - $(TESTENV) ./mktest$(EXEEXT) write 1 100 100 test/content + $(TESTENV) ./mktest$(EXEEXT) write 1 100 100 bench/content $(FAILENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-failure -c $(CONF) sync - rm test/content + rm bench/content echo --- Delete some files, create some new, sync and check - rm test/disk1/a/1* - rm test/disk2/a/2* - rm test/disk3/a/3* - rm test/disk4/a/4* + rm bench/disk1/a/1* + rm bench/disk2/a/2* + rm bench/disk3/a/3* + rm bench/disk4/a/4* $(TESTENV) ./mktest$(EXEEXT) generate 3 6 $(CHECKCOUNT) $(CHECKSIZE) $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Move some files, sync and check - mv test/disk1/a/7* test/disk1/b/ - mv test/disk2/a/7* test/disk2/b/ - mv test/disk3/a/7* test/disk3/b/ - mv test/disk4/a/7* test/disk4/b/ + mv bench/disk1/a/7* bench/disk1/b/ + mv bench/disk2/a/7* bench/disk2/b/ + mv bench/disk3/a/7* bench/disk3/b/ + mv bench/disk4/a/7* bench/disk4/b/ $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete one disk, fix and check with PAR1 - rm -r test/disk3 - mkdir test/disk3 + rm -r bench/disk3 + mkdir bench/disk3 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete two disks, fix and check with PAR2 - rm -r test/disk1 - mkdir test/disk1 - rm -r test/disk2 - mkdir test/disk2 + rm -r bench/disk1 + mkdir bench/disk1 + rm -r bench/disk2 + mkdir bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -l test-fail-strategy1.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete three disks, fix and check with PAR3 - rm -r test/disk1 - mkdir test/disk1 - rm -r test/disk2 - mkdir test/disk2 - rm -r test/disk3 - mkdir test/disk3 + rm -r bench/disk1 + mkdir bench/disk1 + rm -r bench/disk2 + mkdir bench/disk2 + rm -r bench/disk3 + mkdir bench/disk3 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test-fail-strategy2.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR3) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR3) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete four disks, fix and check with PAR4 - rm -r test/disk3 - mkdir test/disk3 - rm -r test/disk4 - mkdir test/disk4 - rm -r test/disk5 - mkdir test/disk5 - rm -r test/disk6 - mkdir test/disk6 + rm -r bench/disk3 + mkdir bench/disk3 + rm -r bench/disk4 + mkdir bench/disk4 + rm -r bench/disk5 + mkdir bench/disk5 + rm -r bench/disk6 + mkdir bench/disk6 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR3) fix -l test-fail-strategy3.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR4) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR4) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete five disks, fix and check with PAR5 - rm -r test/disk1 - mkdir test/disk1 - rm -r test/disk2 - mkdir test/disk2 - rm -r test/disk3 - mkdir test/disk3 - rm -r test/disk5 - mkdir test/disk5 - rm -r test/disk6 - mkdir test/disk6 + rm -r bench/disk1 + mkdir bench/disk1 + rm -r bench/disk2 + mkdir bench/disk2 + rm -r bench/disk3 + mkdir bench/disk3 + rm -r bench/disk5 + mkdir bench/disk5 + rm -r bench/disk6 + mkdir bench/disk6 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR4) fix -l test-fail-strategy4.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR5) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR5) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete six disks, fix and check with PAR6 - rm -r test/disk1 - mkdir test/disk1 - rm -r test/disk2 - mkdir test/disk2 - rm -r test/disk3 - mkdir test/disk3 - rm -r test/disk4 - mkdir test/disk4 - rm -r test/disk5 - mkdir test/disk5 - rm -r test/disk6 - mkdir test/disk6 + rm -r bench/disk1 + mkdir bench/disk1 + rm -r bench/disk2 + mkdir bench/disk2 + rm -r bench/disk3 + mkdir bench/disk3 + rm -r bench/disk4 + mkdir bench/disk4 + rm -r bench/disk5 + mkdir bench/disk5 + rm -r bench/disk6 + mkdir bench/disk6 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR5) fix -l test-fail-strategy5.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR6) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR6) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Delete some files and create some new, sync and check in multiple steps using text content - rm test/disk1/a/4* - rm test/disk2/a/5* - rm test/disk3/a/6* - rm test/disk4/a/6* + rm bench/disk1/a/4* + rm bench/disk2/a/5* + rm bench/disk3/a/6* + rm bench/disk4/a/6* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -t 10 sync --test-force-content-text - cp test/content test/content.txt + cp bench/content bench/content.txt $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) test-rewrite $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-force-content-text test-rewrite - cmp test/content test/content.txt + cmp bench/content bench/content.txt $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check -l test.log $(TESTENV) ./mktest$(EXEEXT) generate 4 6 $(CHECKCOUNT) $(CHECKSIZE) $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -t 100 sync --test-force-content-text - cp test/content test/content.txt + cp bench/content bench/content.txt $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) test-rewrite $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-force-content-text test-rewrite - cmp test/content test/content.txt + cmp bench/content bench/content.txt $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -t 1000 sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync @@ -395,156 +403,156 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete files from three disks and check/fix with import in PAR2 - rm -r test/disk1/a - rm -r test/disk2/a - mv test/disk3/a test/a - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -i test/a -c $(PAR2) fix -l test.log - rm -r test/a + rm -r bench/disk1/a + rm -r bench/disk2/a + mv bench/disk3/a bench/a + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -i bench/a -c $(PAR2) fix -l test.log + rm -r bench/a $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync late with additions, delete them and recover with PAR2 echo --- This triggers the recovering with q using p to check the validity - cp -pR test/disk1/a test/disk1/a_copy + cp -pR bench/disk1/a bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync -c $(CONF) sync - rm -r test/disk1/a_copy + rm -r bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log - rm -r test/disk1/a_copy + rm -r bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync early with additions, delete them and recover with PAR2 echo --- This triggers the recovering with q using p to check the validity, but failing for new block being filled with zero - cp -pR test/disk1/a test/disk1/a_copy + cp -pR bench/disk1/a bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -t 1 --test-kill-after-sync -c $(CONF) sync - rm -r test/disk1/a_copy + rm -r bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test-fail-earlysyncadd.log - rm -r test/disk1/a_copy + rm -r bench/disk1/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync late with additions with prehash and then delete the new additions and sync again - cp -pR test/disk1/a test/disk1/a_copy - cp -pR test/disk2/a test/disk2/a_copy - cp -pR test/disk3/a test/disk3/a_copy + cp -pR bench/disk1/a bench/disk1/a_copy + cp -pR bench/disk2/a bench/disk2/a_copy + cp -pR bench/disk3/a bench/disk3/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync -c $(CONF) -h sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - rm -r test/disk1/a_copy - rm -r test/disk2/a_copy - rm -r test/disk3/a_copy + rm -r bench/disk1/a_copy + rm -r bench/disk2/a_copy + rm -r bench/disk3/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync late with additions and then delete the new additions and sync again - cp -pR test/disk1/a test/disk1/a_copy - cp -pR test/disk2/a test/disk2/a_copy - cp -pR test/disk3/a test/disk3/a_copy + cp -pR bench/disk1/a bench/disk1/a_copy + cp -pR bench/disk2/a bench/disk2/a_copy + cp -pR bench/disk3/a bench/disk3/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - rm -r test/disk1/a_copy - rm -r test/disk2/a_copy - rm -r test/disk3/a_copy + rm -r bench/disk1/a_copy + rm -r bench/disk2/a_copy + rm -r bench/disk3/a_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync late with additions and then delete some unchanged stuff and fix with PAR1 - cp -pR test/disk1/b test/disk1/b_copy + cp -pR bench/disk1/b bench/disk1/b_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) --test-kill-after-sync sync - rm -r test/disk2 - mkdir test/disk2 + rm -r bench/disk2 + mkdir bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log echo --- Fixes again to restore all the parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) fix -l test.log - rm -r test/disk1/b_copy + rm -r bench/disk1/b_copy $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync echo --- Abort sync late with more deletions than additions and then delete some unchanged stuff and fix with PAR1 - cp -pR test/disk1/a test/disk1/a_copy - mv test/disk1/a test/a - mv test/disk1/b test/b + cp -pR bench/disk1/a bench/disk1/a_copy + mv bench/disk1/a bench/a + mv bench/disk1/b bench/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-kill-after-sync sync - rm -r test/disk2 - mkdir test/disk2 + rm -r bench/disk2 + mkdir bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log echo --- Fixes again to restore all the parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) fix -l test.log - -rm -r test/disk1/a - -rm -r test/disk1/b - rm -r test/disk1/a_copy - mv test/a test/disk1/a - mv test/b test/disk1/b + -rm -r bench/disk1/a + -rm -r bench/disk1/b + rm -r bench/disk1/a_copy + mv bench/a bench/disk1/a + mv bench/b bench/disk1/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Abort sync early with more deletions than additions and then delete some unchanged stuff and fix with PAR2 - cp -pR test/disk1/a test/disk1/a_copy - mv test/disk1/a test/a - mv test/disk1/b test/b + cp -pR bench/disk1/a bench/disk1/a_copy + mv bench/disk1/a bench/a + mv bench/disk1/b bench/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -t 1 --test-kill-after-sync sync - rm -r test/disk2 - mkdir test/disk2 + rm -r bench/disk2 + mkdir bench/disk2 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -l test-fail-earlysyncdel.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log - -rm -r test/disk1/a - -rm -r test/disk1/b - rm -r test/disk1/a_copy - mv test/a test/disk1/a - mv test/b test/disk1/b + -rm -r bench/disk1/a + -rm -r bench/disk1/b + rm -r bench/disk1/a_copy + mv bench/a bench/disk1/a + mv bench/b bench/disk1/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete some files, fix with -m and check with PAR1 - rm test/disk1/a/8* + rm bench/disk1/a/8* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) -m fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete some dirs in six disk, fix with -m and check - rm -r test/disk1/b - rm -r test/disk2/b - rm -r test/disk3/b - rm -r test/disk4/b - rm -r test/disk5/b - rm -r test/disk6/b + rm -r bench/disk1/b + rm -r bench/disk2/b + rm -r bench/disk3/b + rm -r bench/disk4/b + rm -r bench/disk5/b + rm -r bench/disk6/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR5) fix -l test-full5.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(CONF) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -m fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete some dirs in two disks, fix and check with PAR2 using the -d option for each disk - rm -r test/disk2/b - rm -r test/disk5/b + rm -r bench/disk2/b + rm -r bench/disk5/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -l test-full1.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) -d disk2 fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) -d disk5 fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete the parity, fix and check with PAR1 - rm test/parity + rm bench/parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete the parity and the 2-parity, fix and check with PAR2 - rm test/parity - rm test/2-parity + rm bench/parity + rm bench/2-parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete the parity and a disk, fix and check with PAR2 - rm test/parity - rm -r test/disk2/b + rm bench/parity + rm -r bench/disk2/b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Delete the 2-parity and a disk, fix and check with PAR2 - rm test/2-parity - rm -r test/disk3/a + rm bench/2-parity + rm -r bench/disk3/a $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt the parity, fix and check with PAR1 - $(TESTENV) ./mktest$(EXEEXT) write 1 100 10000 test/parity + $(TESTENV) ./mktest$(EXEEXT) write 1 100 10000 bench/parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) -a check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt the parity and the 2-parity, fix and check with PAR2 - $(TESTENV) ./mktest$(EXEEXT) write 2 100 10000 test/parity - $(TESTENV) ./mktest$(EXEEXT) write 2 100 10000 test/2-parity + $(TESTENV) ./mktest$(EXEEXT) write 2 100 10000 bench/parity + $(TESTENV) ./mktest$(EXEEXT) write 2 100 10000 bench/2-parity $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -a check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt some files, fix and check with PAR1 - $(TESTENV) ./mktest$(EXEEXT) change 3 500 test/disk2/b/* + $(TESTENV) ./mktest$(EXEEXT) change 3 500 bench/disk2/b/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) -a check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt some files, fix and check with PAR2 in verbose mode - $(TESTENV) ./mktest$(EXEEXT) change 4 500 test/disk2/b/* - $(TESTENV) ./mktest$(EXEEXT) change 4 500 test/disk3/b/* + $(TESTENV) ./mktest$(EXEEXT) change 4 500 bench/disk2/b/* + $(TESTENV) ./mktest$(EXEEXT) change 4 500 bench/disk3/b/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) --test-expect-unrecoverable -c $(PAR1) check -l test.log > /dev/null $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS_VERBOSE) --test-expect-unrecoverable -c $(PAR1) fix -l test-fail-corrupt-verbose.log > /dev/null $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) -a check -l test.log @@ -552,22 +560,22 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt some files, fix and check with PAR2 - $(TESTENV) ./mktest$(EXEEXT) change 5 500 test/disk2/b/* - $(TESTENV) ./mktest$(EXEEXT) change 5 500 test/disk3/b/* + $(TESTENV) ./mktest$(EXEEXT) change 5 500 bench/disk2/b/* + $(TESTENV) ./mktest$(EXEEXT) change 5 500 bench/disk3/b/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) check -l test-fail-corrupt-data.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt the parity and some files, fix and check with PAR2 - $(TESTENV) ./mktest$(EXEEXT) write 6 100 10000 test/parity - $(TESTENV) ./mktest$(EXEEXT) change 6 500 test/disk1/a/* + $(TESTENV) ./mktest$(EXEEXT) write 6 100 10000 bench/parity + $(TESTENV) ./mktest$(EXEEXT) change 6 500 bench/disk1/a/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) check -l test-fail-corrupt-parity.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Corrupt the 2-parity and some files, fix and check with PAR2 - $(TESTENV) ./mktest$(EXEEXT) write 7 100 10000 test/2-parity - $(TESTENV) ./mktest$(EXEEXT) change 7 500 test/disk1/a/* + $(TESTENV) ./mktest$(EXEEXT) write 7 100 10000 bench/2-parity + $(TESTENV) ./mktest$(EXEEXT) change 7 500 bench/disk1/a/* $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR1) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log @@ -579,7 +587,7 @@ endif # Manual testing -MANUAL = ./snapraid --test-skip-device -c test-par1.conf sync +MANUAL = ./snapraid --test-skip-device -c test/test-par1.conf sync valgrind: valgrind \ diff --git a/configure.ac b/configure.ac index 02d22dbe..a11aa8a4 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.65]) AC_INIT([snapraid], [6.0], [], [], [http://snapraid.sourceforge.net]) AM_INIT_AUTOMAKE([foreign no-dependencies subdir-objects]) -AC_CONFIG_SRCDIR([snapraid.c]) +AC_CONFIG_SRCDIR([src/snapraid.c]) AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST diff --git a/check.c b/src/check.c similarity index 100% rename from check.c rename to src/check.c diff --git a/dry.c b/src/dry.c similarity index 100% rename from dry.c rename to src/dry.c diff --git a/dup.c b/src/dup.c similarity index 100% rename from dup.c rename to src/dup.c diff --git a/elem.c b/src/elem.c similarity index 100% rename from elem.c rename to src/elem.c diff --git a/elem.h b/src/elem.h similarity index 99% rename from elem.h rename to src/elem.h index c3a1cddd..39149fc0 100644 --- a/elem.h +++ b/src/elem.h @@ -19,12 +19,12 @@ #define __ELEM_H #include "util.h" -#include "tommylist.h" -#include "tommyhash.h" -#include "tommyhashdyn.h" -#include "tommyarray.h" -#include "tommyarrayblk.h" -#include "tommyarrayblkof.h" +#include "tommyds/tommylist.h" +#include "tommyds/tommyhash.h" +#include "tommyds/tommyhashdyn.h" +#include "tommyds/tommyarray.h" +#include "tommyds/tommyarrayblk.h" +#include "tommyds/tommyarrayblkof.h" /****************************************************************************/ /* snapraid */ diff --git a/fnmatch.c b/src/fnmatch.c similarity index 100% rename from fnmatch.c rename to src/fnmatch.c diff --git a/fnmatch.h b/src/fnmatch.h similarity index 100% rename from fnmatch.h rename to src/fnmatch.h diff --git a/handle.c b/src/handle.c similarity index 100% rename from handle.c rename to src/handle.c diff --git a/handle.h b/src/handle.h similarity index 100% rename from handle.h rename to src/handle.h diff --git a/import.c b/src/import.c similarity index 100% rename from import.c rename to src/import.c diff --git a/import.h b/src/import.h similarity index 100% rename from import.h rename to src/import.h diff --git a/list.c b/src/list.c similarity index 100% rename from list.c rename to src/list.c diff --git a/mingw.c b/src/mingw.c similarity index 100% rename from mingw.c rename to src/mingw.c diff --git a/mingw.h b/src/mingw.h similarity index 100% rename from mingw.h rename to src/mingw.h diff --git a/mktest.c b/src/mktest.c similarity index 99% rename from mktest.c rename to src/mktest.c index 89f3afeb..e230bbe7 100644 --- a/mktest.c +++ b/src/mktest.c @@ -116,7 +116,7 @@ void generate(int disk, int size) char path[PATH_MAX]; char* file; - snprintf(path, sizeof(path), "test/disk%d/", disk); + snprintf(path, sizeof(path), "bench/disk%d/", disk); file = path + strlen(path); /* add a directory */ diff --git a/murmur3.c b/src/murmur3.c similarity index 100% rename from murmur3.c rename to src/murmur3.c diff --git a/murmur3test.c b/src/murmur3test.c similarity index 100% rename from murmur3test.c rename to src/murmur3test.c diff --git a/parity.c b/src/parity.c similarity index 100% rename from parity.c rename to src/parity.c diff --git a/parity.h b/src/parity.h similarity index 100% rename from parity.h rename to src/parity.h diff --git a/pool.c b/src/pool.c similarity index 100% rename from pool.c rename to src/pool.c diff --git a/portable.h b/src/portable.h similarity index 100% rename from portable.h rename to src/portable.h diff --git a/raid/COPYING b/src/raid/COPYING similarity index 100% rename from raid/COPYING rename to src/raid/COPYING diff --git a/raid/combo.h b/src/raid/combo.h similarity index 100% rename from raid/combo.h rename to src/raid/combo.h diff --git a/raid/cpu.h b/src/raid/cpu.h similarity index 100% rename from raid/cpu.h rename to src/raid/cpu.h diff --git a/raid/gf.h b/src/raid/gf.h similarity index 100% rename from raid/gf.h rename to src/raid/gf.h diff --git a/raid/helper.c b/src/raid/helper.c similarity index 100% rename from raid/helper.c rename to src/raid/helper.c diff --git a/raid/helper.h b/src/raid/helper.h similarity index 100% rename from raid/helper.h rename to src/raid/helper.h diff --git a/raid/int.c b/src/raid/int.c similarity index 100% rename from raid/int.c rename to src/raid/int.c diff --git a/raid/internal.h b/src/raid/internal.h similarity index 100% rename from raid/internal.h rename to src/raid/internal.h diff --git a/raid/intz.c b/src/raid/intz.c similarity index 100% rename from raid/intz.c rename to src/raid/intz.c diff --git a/raid/memory.c b/src/raid/memory.c similarity index 100% rename from raid/memory.c rename to src/raid/memory.c diff --git a/raid/memory.h b/src/raid/memory.h similarity index 100% rename from raid/memory.h rename to src/raid/memory.h diff --git a/raid/mktables.c b/src/raid/mktables.c similarity index 100% rename from raid/mktables.c rename to src/raid/mktables.c diff --git a/raid/module.c b/src/raid/module.c similarity index 100% rename from raid/module.c rename to src/raid/module.c diff --git a/raid/raid.c b/src/raid/raid.c similarity index 100% rename from raid/raid.c rename to src/raid/raid.c diff --git a/raid/raid.h b/src/raid/raid.h similarity index 100% rename from raid/raid.h rename to src/raid/raid.h diff --git a/raid/sort.c b/src/raid/sort.c similarity index 100% rename from raid/sort.c rename to src/raid/sort.c diff --git a/raid/tables.c b/src/raid/tables.c similarity index 100% rename from raid/tables.c rename to src/raid/tables.c diff --git a/raid/tag.c b/src/raid/tag.c similarity index 100% rename from raid/tag.c rename to src/raid/tag.c diff --git a/raid/test.c b/src/raid/test.c similarity index 100% rename from raid/test.c rename to src/raid/test.c diff --git a/raid/test.h b/src/raid/test.h similarity index 100% rename from raid/test.h rename to src/raid/test.h diff --git a/raid/test/Makefile b/src/raid/test/Makefile similarity index 100% rename from raid/test/Makefile rename to src/raid/test/Makefile diff --git a/raid/test/fulltest.c b/src/raid/test/fulltest.c similarity index 100% rename from raid/test/fulltest.c rename to src/raid/test/fulltest.c diff --git a/raid/test/invtest.c b/src/raid/test/invtest.c similarity index 100% rename from raid/test/invtest.c rename to src/raid/test/invtest.c diff --git a/raid/test/selftest.c b/src/raid/test/selftest.c similarity index 100% rename from raid/test/selftest.c rename to src/raid/test/selftest.c diff --git a/raid/test/speedtest.c b/src/raid/test/speedtest.c similarity index 100% rename from raid/test/speedtest.c rename to src/raid/test/speedtest.c diff --git a/raid/x86.c b/src/raid/x86.c similarity index 100% rename from raid/x86.c rename to src/raid/x86.c diff --git a/raid/x86z.c b/src/raid/x86z.c similarity index 100% rename from raid/x86z.c rename to src/raid/x86z.c diff --git a/rehash.c b/src/rehash.c similarity index 100% rename from rehash.c rename to src/rehash.c diff --git a/scan.c b/src/scan.c similarity index 100% rename from scan.c rename to src/scan.c diff --git a/scrub.c b/src/scrub.c similarity index 100% rename from scrub.c rename to src/scrub.c diff --git a/selftest.c b/src/selftest.c similarity index 98% rename from selftest.c rename to src/selftest.c index 708d084e..24f6daf7 100644 --- a/selftest.c +++ b/src/selftest.c @@ -26,11 +26,11 @@ #include "raid/test.h" #include "elem.h" #include "state.h" -#include "tommyhash.h" -#include "tommyarray.h" -#include "tommyarrayblk.h" -#include "tommyarrayblkof.h" -#include "tommyhashdyn.h" +#include "tommyds/tommyhash.h" +#include "tommyds/tommyarray.h" +#include "tommyds/tommyarrayblk.h" +#include "tommyds/tommyarrayblkof.h" +#include "tommyds/tommyhashdyn.h" struct hash32_test_vector { const char* data; diff --git a/snapraid.c b/src/snapraid.c similarity index 100% rename from snapraid.c rename to src/snapraid.c diff --git a/snapraid.h b/src/snapraid.h similarity index 100% rename from snapraid.h rename to src/snapraid.h diff --git a/speed.c b/src/speed.c similarity index 100% rename from speed.c rename to src/speed.c diff --git a/spooky2.c b/src/spooky2.c similarity index 100% rename from spooky2.c rename to src/spooky2.c diff --git a/spooky2test.c b/src/spooky2test.c similarity index 100% rename from spooky2test.c rename to src/spooky2test.c diff --git a/state.c b/src/state.c similarity index 100% rename from state.c rename to src/state.c diff --git a/state.h b/src/state.h similarity index 100% rename from state.h rename to src/state.h diff --git a/status.c b/src/status.c similarity index 100% rename from status.c rename to src/status.c diff --git a/sync.c b/src/sync.c similarity index 100% rename from sync.c rename to src/sync.c diff --git a/src/tommyds/LICENSE b/src/tommyds/LICENSE new file mode 100644 index 00000000..171febee --- /dev/null +++ b/src/tommyds/LICENSE @@ -0,0 +1,25 @@ +Copyright 2010 Andrea Mazzoleni. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY ANDREA MAZZOLENI AND CONTRIBUTORS ``AS IS'' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ANDREA MAZZOLENI OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + diff --git a/tommy.c b/src/tommyds/tommy.c similarity index 93% rename from tommy.c rename to src/tommyds/tommy.c index adbe841d..b826e56f 100644 --- a/tommy.c +++ b/src/tommyds/tommy.c @@ -15,9 +15,8 @@ * along with this program. If not, see . */ -#include "portable.h" - -#include "util.h" /* for safe_malloc */ +#include "../portable.h" +#include "../util.h" /* for safe_malloc */ /* redefine the malloc for tommy use */ #define tommy_malloc malloc_nofail diff --git a/tommyarray.c b/src/tommyds/tommyarray.c similarity index 100% rename from tommyarray.c rename to src/tommyds/tommyarray.c diff --git a/tommyarray.h b/src/tommyds/tommyarray.h similarity index 100% rename from tommyarray.h rename to src/tommyds/tommyarray.h diff --git a/tommyarrayblk.c b/src/tommyds/tommyarrayblk.c similarity index 100% rename from tommyarrayblk.c rename to src/tommyds/tommyarrayblk.c diff --git a/tommyarrayblk.h b/src/tommyds/tommyarrayblk.h similarity index 100% rename from tommyarrayblk.h rename to src/tommyds/tommyarrayblk.h diff --git a/tommyarrayblkof.c b/src/tommyds/tommyarrayblkof.c similarity index 100% rename from tommyarrayblkof.c rename to src/tommyds/tommyarrayblkof.c diff --git a/tommyarrayblkof.h b/src/tommyds/tommyarrayblkof.h similarity index 100% rename from tommyarrayblkof.h rename to src/tommyds/tommyarrayblkof.h diff --git a/tommychain.h b/src/tommyds/tommychain.h similarity index 100% rename from tommychain.h rename to src/tommyds/tommychain.h diff --git a/tommyhash.c b/src/tommyds/tommyhash.c similarity index 100% rename from tommyhash.c rename to src/tommyds/tommyhash.c diff --git a/tommyhash.h b/src/tommyds/tommyhash.h similarity index 100% rename from tommyhash.h rename to src/tommyds/tommyhash.h diff --git a/tommyhashdyn.c b/src/tommyds/tommyhashdyn.c similarity index 100% rename from tommyhashdyn.c rename to src/tommyds/tommyhashdyn.c diff --git a/tommyhashdyn.h b/src/tommyds/tommyhashdyn.h similarity index 100% rename from tommyhashdyn.h rename to src/tommyds/tommyhashdyn.h diff --git a/tommylist.c b/src/tommyds/tommylist.c similarity index 100% rename from tommylist.c rename to src/tommyds/tommylist.c diff --git a/tommylist.h b/src/tommyds/tommylist.h similarity index 100% rename from tommylist.h rename to src/tommyds/tommylist.h diff --git a/tommytypes.h b/src/tommyds/tommytypes.h similarity index 100% rename from tommytypes.h rename to src/tommyds/tommytypes.h diff --git a/unix.c b/src/unix.c similarity index 100% rename from unix.c rename to src/unix.c diff --git a/unix.h b/src/unix.h similarity index 100% rename from unix.h rename to src/unix.h diff --git a/util.c b/src/util.c similarity index 100% rename from util.c rename to src/util.c diff --git a/util.h b/src/util.h similarity index 100% rename from util.h rename to src/util.h diff --git a/test-par1.conf b/test-par1.conf deleted file mode 100644 index dca7f6fa..00000000 --- a/test-par1.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Test configuration file -blocksize 1 -parity test/parity -content test/content -content test/1-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable -pool test/pool -share \\server\jbod -autosave 1 - diff --git a/test-par2.conf b/test-par2.conf deleted file mode 100644 index 04bde1ac..00000000 --- a/test-par2.conf +++ /dev/null @@ -1,15 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -content test/content -content test/1-content -content test/2-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test-par3.conf b/test-par3.conf deleted file mode 100644 index 49176d28..00000000 --- a/test-par3.conf +++ /dev/null @@ -1,17 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -3-parity test/3-parity -content test/content -content test/1-content -content test/2-content -content test/3-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test-par4.conf b/test-par4.conf deleted file mode 100644 index 46844d60..00000000 --- a/test-par4.conf +++ /dev/null @@ -1,19 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -3-parity test/3-parity -4-parity test/4-parity -content test/content -content test/1-content -content test/2-content -content test/3-content -content test/4-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test-par5.conf b/test-par5.conf deleted file mode 100644 index 2f2767dc..00000000 --- a/test-par5.conf +++ /dev/null @@ -1,21 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -3-parity test/3-parity -4-parity test/4-parity -5-parity test/5-parity -content test/content -content test/1-content -content test/2-content -content test/3-content -content test/4-content -content test/5-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test-par6-hole.conf b/test-par6-hole.conf deleted file mode 100644 index 36d47640..00000000 --- a/test-par6-hole.conf +++ /dev/null @@ -1,22 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -3-parity test/3-parity -4-parity test/4-parity -5-parity test/5-parity -6-parity test/6-parity -content test/content -content test/1-content -content test/2-content -content test/3-content -content test/4-content -content test/5-content -content test/6-content -disk disk1 test/disk1/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test-par6.conf b/test-par6.conf deleted file mode 100644 index 804b28cd..00000000 --- a/test-par6.conf +++ /dev/null @@ -1,23 +0,0 @@ -blocksize 1 -parity test/parity -2-parity test/2-parity -3-parity test/3-parity -4-parity test/4-parity -5-parity test/5-parity -6-parity test/6-parity -content test/content -content test/1-content -content test/2-content -content test/3-content -content test/4-content -content test/5-content -content test/6-content -disk disk1 test/disk1/ -disk disk2 test/disk2/ -disk disk3 test/disk3/ -disk disk4 test/disk4/ -disk disk5 test/disk5/ -disk disk6 test/disk6/ -include *.hidden -exclude *.unrecoverable - diff --git a/test/test-par1.conf b/test/test-par1.conf new file mode 100644 index 00000000..b0e48400 --- /dev/null +++ b/test/test-par1.conf @@ -0,0 +1,17 @@ +# Test configuration file +blocksize 1 +parity bench/parity +content bench/content +content bench/1-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable +pool bench/pool +share \\server\jbod +autosave 1 + diff --git a/test/test-par2.conf b/test/test-par2.conf new file mode 100644 index 00000000..219aa26e --- /dev/null +++ b/test/test-par2.conf @@ -0,0 +1,15 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +content bench/content +content bench/1-content +content bench/2-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable + diff --git a/test/test-par3.conf b/test/test-par3.conf new file mode 100644 index 00000000..5c726d40 --- /dev/null +++ b/test/test-par3.conf @@ -0,0 +1,17 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +3-parity bench/3-parity +content bench/content +content bench/1-content +content bench/2-content +content bench/3-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable + diff --git a/test/test-par4.conf b/test/test-par4.conf new file mode 100644 index 00000000..9bf51d83 --- /dev/null +++ b/test/test-par4.conf @@ -0,0 +1,19 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +3-parity bench/3-parity +4-parity bench/4-parity +content bench/content +content bench/1-content +content bench/2-content +content bench/3-content +content bench/4-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable + diff --git a/test/test-par5.conf b/test/test-par5.conf new file mode 100644 index 00000000..2a698ff9 --- /dev/null +++ b/test/test-par5.conf @@ -0,0 +1,21 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +3-parity bench/3-parity +4-parity bench/4-parity +5-parity bench/5-parity +content bench/content +content bench/1-content +content bench/2-content +content bench/3-content +content bench/4-content +content bench/5-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable + diff --git a/test/test-par6-hole.conf b/test/test-par6-hole.conf new file mode 100644 index 00000000..e62c6220 --- /dev/null +++ b/test/test-par6-hole.conf @@ -0,0 +1,22 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +3-parity bench/3-parity +4-parity bench/4-parity +5-parity bench/5-parity +6-parity bench/6-parity +content bench/content +content bench/1-content +content bench/2-content +content bench/3-content +content bench/4-content +content bench/5-content +content bench/6-content +disk disk1 bench/disk1/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable + diff --git a/test/test-par6.conf b/test/test-par6.conf new file mode 100644 index 00000000..4d6616bc --- /dev/null +++ b/test/test-par6.conf @@ -0,0 +1,23 @@ +blocksize 1 +parity bench/parity +2-parity bench/2-parity +3-parity bench/3-parity +4-parity bench/4-parity +5-parity bench/5-parity +6-parity bench/6-parity +content bench/content +content bench/1-content +content bench/2-content +content bench/3-content +content bench/4-content +content bench/5-content +content bench/6-content +disk disk1 bench/disk1/ +disk disk2 bench/disk2/ +disk disk3 bench/disk3/ +disk disk4 bench/disk4/ +disk disk5 bench/disk5/ +disk disk6 bench/disk6/ +include *.hidden +exclude *.unrecoverable +