From 915c3b92023978d350520bd708876212f7b864f7 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 13 Nov 2013 21:35:44 +0100 Subject: [PATCH] Renames parity level from RAID to PAR. --- Makefile.am | 210 ++++----- check.c | 14 +- cpu.h | 192 ++++---- mktables.c | 4 +- raid.c | 465 ++++++++++--------- raid.h | 115 +++-- scrub.c | 2 +- selftest.c | 84 ++-- snapraid.1 | 9 +- snapraid.d | 9 +- snapraid.txt | 9 +- speed.c | 144 +++--- state.c | 38 +- state.h | 2 +- sync.c | 2 +- tables.h | 4 +- test-raid5.conf => test-par1.conf | 0 test-raid6.conf => test-par2.conf | 0 test-raidS3.conf => test-par3.conf | 0 test-raidS4.conf => test-par4.conf | 0 test-raidS5.conf => test-par5.conf | 0 test-raidS6-hole.conf => test-par6-hole.conf | 0 test-raidS6.conf => test-par6.conf | 0 util.c | 12 +- 24 files changed, 656 insertions(+), 659 deletions(-) rename test-raid5.conf => test-par1.conf (100%) rename test-raid6.conf => test-par2.conf (100%) rename test-raidS3.conf => test-par3.conf (100%) rename test-raidS4.conf => test-par4.conf (100%) rename test-raidS5.conf => test-par5.conf (100%) rename test-raidS6-hole.conf => test-par6-hole.conf (100%) rename test-raidS6.conf => test-par6.conf (100%) diff --git a/Makefile.am b/Makefile.am index 8e0ae731..5631e8cd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -75,7 +75,7 @@ EXTRA_DIST = \ noautomake.sh \ README AUTHORS HISTORY INSTALL COPYING TODO TEST INSTALL.windows \ snapraid.d snapraid.1 snapraid.txt \ - test-raid5.conf test-raid6.conf test-raidS3.conf test-raidS4.conf test-raidS5.conf test-raidS6.conf test-raidS6-hole.conf \ + test-par1.conf test-par2.conf test-par3.conf test-par4.conf test-par5.conf test-par6.conf test-par6-hole.conf \ snapraid.conf.example \ configure.windows-x86 configure.windows-x64 snapraid.conf.example.windows \ acinclude.m4 @@ -99,14 +99,14 @@ maintainer-clean-local: CHECKFLAGS = --test-skip-device --test-skip-self -q CHECKCOUNT = 2000 CHECKSIZE = 4000 -CONF = $(srcdir)/test-raidS6.conf -HOLE = $(srcdir)/test-raidS6-hole.conf -RAID5 = $(srcdir)/test-raid5.conf -RAID6 = $(srcdir)/test-raid6.conf -RAIDTP = $(srcdir)/test-raidS3.conf -RAIDQP = $(srcdir)/test-raidS4.conf -RAIDPP = $(srcdir)/test-raidS5.conf -RAIDHP = $(srcdir)/test-raidS6.conf +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 check-local: rm -rf test @@ -130,7 +130,7 @@ check-local: $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-force-murmur3 sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status if HAVE_SYMLINK - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) pool + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) pool endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -a check @@ -146,9 +146,9 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(CONF) list -l test.log > output.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status -l test.log if HAVE_SYMLINK - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) pool + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) pool endif - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) check + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -a check echo --- Delete some files and sync @@ -157,7 +157,7 @@ endif rm test/disk6/9* $(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 RAID5 and check + echo --- Create some more files, hardlinks and empty directories, delete others, sync PAR1 and check rm test/disk4/8* rm test/disk5/8* rm test/disk6/8* @@ -176,20 +176,20 @@ endif echo 3 > test/disk3/file_hardlink1 ln test/disk3/file_hardlink1 test/disk3/file_hardlink2 ln test/disk3/file_hardlink1 test/disk3/file_hardlink3 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(RAID5) diff > output.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-fallocate -c $(RAID5) --test-force-order-inode sync + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -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 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-sequential -c $(RAID5) check + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-skip-sequential -c $(PAR1) check echo --- Some commands with a not empty array - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(RAID5) dup - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(RAID5) list > output.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(PAR1) dup + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -v -c $(PAR1) list > output.log if HAVE_SYMLINK - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) pool + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) pool endif - echo --- Extend RAID5 to max parity with fix and check + echo --- Extend PAR1 to max parity with fix and check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(CONF) check -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) check + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Dry $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) dry @@ -246,36 +246,36 @@ endif mv test/disk4/7* test/disk4/_a/ $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Delete one disk, fix and check with RAID5 + echo --- Delete one disk, fix and check with PAR1 rm -r test/disk3 mkdir test/disk3 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Delete two disks, fix and check with RAID6 + echo --- Delete two disks, fix and check with PAR2 rm -r test/disk1 mkdir test/disk1 rm -r test/disk2 mkdir test/disk2 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Delete three disks, fix and check with RAIDTP + 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 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID6) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAIDTP) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAIDTP) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test.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 RAIDQP + echo --- Delete four disks, fix and check with PAR4 rm -r test/disk3 mkdir test/disk3 rm -r test/disk4 @@ -284,12 +284,12 @@ endif mkdir test/disk5 rm -r test/disk6 mkdir test/disk6 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAIDTP) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAIDQP) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAIDQP) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR3) fix -l test.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 RAIDPP + echo --- Delete five disks, fix and check with PAR5 rm -r test/disk1 mkdir test/disk1 rm -r test/disk2 @@ -300,12 +300,12 @@ endif mkdir test/disk5 rm -r test/disk6 mkdir test/disk6 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAIDQP) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAIDPP) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAIDPP) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR4) fix -l test.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 RAIDHP + echo --- Delete six disks, fix and check with PAR6 rm -r test/disk1 mkdir test/disk1 rm -r test/disk2 @@ -318,9 +318,9 @@ endif mkdir test/disk5 rm -r test/disk6 mkdir test/disk6 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAIDPP) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAIDHP) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAIDHP) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR5) fix -l test.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 @@ -349,35 +349,35 @@ endif $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-force-scrub-even scrub $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) status $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Delete files from three disks and fix with import in RAID6 + echo --- Delete files from three disks and fix with import in PAR2 rm -r test/disk1/_a rm -r test/disk1/_b rm -r test/disk2/_a rm -r test/disk2/_b mv test/disk3/_a test/_a - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID6) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -i test/_a -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -i test/_a -c $(PAR2) fix -l test.log rm -r test/_a $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Abort sync late with additions, delete them and recover with RAID6 + 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/_c cp -pR test/disk1/_a test/disk1/_d $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-kill-after-sync -c $(CONF) sync rm -r test/disk1/_c rm -r test/disk1/_d - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log rm -r test/disk1/_c rm -r test/disk1/_d $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Abort sync early with additions, delete them and recover with RAID6 + 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/_c cp -pR test/disk1/_a test/disk1/_d $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -t 1 --test-kill-after-sync -c $(CONF) sync rm -r test/disk1/_c rm -r test/disk1/_d - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR2) fix -l test.log rm -r test/disk1/_c rm -r test/disk1/_d $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync @@ -390,24 +390,24 @@ endif rm -r test/disk2/_c rm -r test/disk3/_c $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync - echo --- Abort sync late with additions and then delete some unchanged stuff and fix with RAID5 + echo --- Abort sync late with additions and then delete some unchanged stuff and fix with PAR1 cp -pR test/disk1/_b test/disk1/_c - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) --test-kill-after-sync sync + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR1) --test-kill-after-sync sync rm -r test/disk2 mkdir test/disk2 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -l test.log + $(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/_c $(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 RAID5 + 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/_c mv test/disk1/_a test/_a mv test/disk1/_b test/_b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) --test-kill-after-sync sync rm -r test/disk2 mkdir test/disk2 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -l test.log + $(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 @@ -417,15 +417,15 @@ endif mv test/_b test/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 RAID6 + 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/_c mv test/disk1/_a test/_a mv test/disk1/_b test/_b $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) -t 1 --test-kill-after-sync sync rm -r test/disk2 mkdir test/disk2 - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -l test.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/_c @@ -433,10 +433,10 @@ endif mv test/_b test/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 RAID5 + echo --- Delete some files, fix with -m and check with PAR1 rm test/disk1/8* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) -m fix -l test.log + $(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/_a @@ -451,63 +451,63 @@ endif rm -r test/disk5/_b rm -r test/disk6/_a rm -r test/disk6/_b - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAIDPP) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR5) fix -l test.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 RAID6 using the -d option for each disk + echo --- Delete some dirs in two disks, fix and check with PAR2 using the -d option for each disk rm -r test/disk2/_a rm -r test/disk2/_b rm -r test/disk5/_a rm -r test/disk5/_b - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) -d disk2 fix -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) -d disk5 fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(PAR1) fix -l test.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 RAID5 + echo --- Delete the parity, fix and check with PAR1 rm test/parity - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -l test.log + $(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 q-parity, fix and check with RAID6 + echo --- Delete the parity and the q-parity, fix and check with PAR2 rm test/parity rm test/q-parity - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(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 RAID6 + echo --- Delete the parity and a disk, fix and check with PAR2 rm test/parity rm -r test/disk2/_a rm -r test/disk2/_b - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(PAR2) fix -l test.log $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Delete the q-parity and a disk, fix and check with RAID6 + echo --- Delete the q-parity and a disk, fix and check with PAR2 rm test/q-parity rm -r test/disk3/_a rm -r test/disk3/_b - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(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 RAID5 + echo --- Corrupt the parity, fix and check with PAR1 $(TESTENV) ./mktest$(EXEEXT) damage 1 100 10000 test/parity - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) -a check - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -l test.log + $(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 q-parity, fix and check with RAID6 + echo --- Corrupt the parity and the q-parity, fix and check with PAR2 $(TESTENV) ./mktest$(EXEEXT) damage 2 100 10000 test/parity $(TESTENV) ./mktest$(EXEEXT) damage 2 100 10000 test/q-parity - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log + $(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 $(RAID6) fix -l test.log + $(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 RAID5 + echo --- Corrupt some files, fix and check with PAR1 $(TESTENV) ./mktest$(EXEEXT) damage 3 1 500 test/disk2/b* $(TESTENV) ./mktest$(EXEEXT) append 3 500 test/disk2/c* $(TESTENV) ./mktest$(EXEEXT) truncate 3 500 test/disk2/d* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) -a check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID5) fix -l test.log + $(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 RAID6 + echo --- Corrupt some files, fix and check with PAR2 $(TESTENV) ./mktest$(EXEEXT) damage 4 1 500 test/disk2/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) damage 4 1 500 test/disk3/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) damage 4 1 500 test/disk2/_a/_b/* @@ -516,12 +516,12 @@ endif $(TESTENV) ./mktest$(EXEEXT) append 4 500 test/disk3/_b/_a/* $(TESTENV) ./mktest$(EXEEXT) truncate 4 500 test/disk2/_b/_b/* $(TESTENV) ./mktest$(EXEEXT) truncate 4 500 test/disk3/_b/_b/* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) -a check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(PAR2) -a check -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Corrupt some files, fix and check with RAID6 + echo --- Corrupt some files, fix and check with PAR2 $(TESTENV) ./mktest$(EXEEXT) damage 5 2 50 test/disk2/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) damage 5 2 50 test/disk3/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) append 5 500 test/disk2/_a/_a/* @@ -532,29 +532,29 @@ endif $(TESTENV) ./mktest$(EXEEXT) append 5 1500 test/disk3/_b/_a/* $(TESTENV) ./mktest$(EXEEXT) truncate 5 1500 test/disk2/_b/_b/* $(TESTENV) ./mktest$(EXEEXT) truncate 5 1500 test/disk3/_b/_b/* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Corrupt the parity and some files, fix and check with RAID6 + echo --- Corrupt the parity and some files, fix and check with PAR2 $(TESTENV) ./mktest$(EXEEXT) damage 6 100 10000 test/parity $(TESTENV) ./mktest$(EXEEXT) damage 6 1 500 test/disk1/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) damage 6 1 500 test/disk1/_a/_b/* $(TESTENV) ./mktest$(EXEEXT) append 6 500 test/disk1/_b/_a/* $(TESTENV) ./mktest$(EXEEXT) truncate 6 500 test/disk1/_b/_b/* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-unrecoverable -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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check - echo --- Corrupt the q-parity and some files, fix and check with RAID6 + echo --- Corrupt the q-parity and some files, fix and check with PAR2 $(TESTENV) ./mktest$(EXEEXT) damage 7 100 10000 test/q-parity $(TESTENV) ./mktest$(EXEEXT) damage 7 1 500 test/disk1/_a/_a/* $(TESTENV) ./mktest$(EXEEXT) damage 7 1 500 test/disk1/_a/_b/* $(TESTENV) ./mktest$(EXEEXT) append 7 500 test/disk1/_b/_a/* $(TESTENV) ./mktest$(EXEEXT) truncate 7 500 test/disk1/_b/_b/* - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID5) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --test-expect-recoverable -c $(RAID6) check -l test.log - $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(RAID6) fix -l test.log + $(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 $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) check echo --- Sync after all the fixes $(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync @@ -563,7 +563,7 @@ endif # Manual testing -MANUAL = ./snapraid --test-skip-device -c test-raid5.conf sync +MANUAL = ./snapraid --test-skip-device -c test-par1.conf sync valgrind: valgrind \ diff --git a/check.c b/check.c index c4f4ab80..c6c29668 100644 --- a/check.c +++ b/check.c @@ -112,7 +112,7 @@ static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned d /* if we checked something, and no block failed the check */ if (hash_checked && j==failed_count) { /* recompute all the redundancy information */ - raid_gen(state->level, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); return 1; } @@ -125,12 +125,12 @@ static int is_hash_matching(struct snapraid_state* state, int rehash, unsigned d static int is_parity_matching(struct snapraid_state* state, unsigned diskmax, unsigned i, unsigned char** buffer, unsigned char** buffer_recov) { /* recompute parity, note that we don't need parity over i */ - raid_gen(i + 1, buffer, diskmax, state->block_size); + raid_par(i + 1, buffer, diskmax, state->block_size); /* if the recovered parity block matches */ if (memcmp(buffer[diskmax+i], buffer_recov[i], state->block_size) == 0) { /* recompute all the redundancy information */ - raid_gen(state->level, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); return 1; } @@ -153,7 +153,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u /* no fix required */ if (failed_count == 0) { /* recompute only the parity */ - raid_gen(state->level, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); return 0; } @@ -199,7 +199,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u memcpy(buffer[diskmax+p[i]], buffer_recov[p[i]], state->block_size); /* recover using one less parity, the p[r-1] one */ - raid_recov(r-1, d, p, buffer, diskmax, buffer_zero, state->block_size); + raid_rec(r-1, d, p, buffer, diskmax, buffer_zero, state->block_size); /* use the remaining p[r-1] parity to check the result */ if (is_parity_matching(state, diskmax, p[r-1], buffer, buffer_recov)) @@ -239,7 +239,7 @@ static int repair_step(struct snapraid_state* state, int rehash, unsigned pos, u memcpy(buffer[diskmax+p[i]], buffer_recov[p[i]], state->block_size); /* recover */ - raid_recov(r, d, p, buffer, diskmax, buffer_zero, state->block_size); + raid_rec(r, d, p, buffer, diskmax, buffer_zero, state->block_size); /* use the hash to check the result */ if (is_hash_matching(state, rehash, diskmax, failed, failed_map, failed_count, buffer, buffer_zero)) @@ -324,7 +324,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign /* if nothing to fix */ if (!something_to_recover) { /* recompute only the parity */ - raid_gen(state->level, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); return 0; } diff --git a/cpu.h b/cpu.h index 306e5b49..2edcb721 100644 --- a/cpu.h +++ b/cpu.h @@ -148,15 +148,15 @@ static inline int cpu_has_slowmult(void) * memset0 1849 [MB/s] * HASH Murmur3 378 [MB/s] (extremely slower than Spooky2) * HASH Spooky2 3413 [MB/s] - * RAID5 int32x2 707 [MB/s] - * RAID5 mmxx2 1264 [MB/s] - * RAID5 mmxx4 1910 [MB/s] - * RAID5 sse2x2 2204 [MB/s] - * RAID5 sse2x4 2980 [MB/s] - * RAID6 int32x2 296 [MB/s] - * RAID6 mmxx2 543 [MB/s] - * RAID6 sse2x2 1068 [MB/s] - * RAID6 sse2x4 1601 [MB/s] + * PAR1 int32x2 707 [MB/s] + * PAR1 mmxx2 1264 [MB/s] + * PAR1 mmxx4 1910 [MB/s] + * PAR1 sse2x2 2204 [MB/s] + * PAR1 sse2x4 2980 [MB/s] + * PAR2 int32x2 296 [MB/s] + * PAR2 mmxx2 543 [MB/s] + * PAR2 sse2x2 1068 [MB/s] + * PAR2 sse2x4 1601 [MB/s] */ if (family == 6 && model == 28) return 1; @@ -191,30 +191,30 @@ static inline int cpu_has_slowpshufb(void) * CRC table 316 [MB/s] * HASH Murmur3 378 [MB/s] * HASH Spooky2 3389 [MB/s] - * RAID5 int32 1800 [MB/s] - * RAID5 int64 2938 [MB/s] - * RAID5 mmx 2946 [MB/s] - * RAID5 sse2 3429 [MB/s] - * RAID5 sse2ext 3447 [MB/s] - * RAID6 int32 519 [MB/s] - * RAID6 int64 944 [MB/s] - * RAID6 mmx 1160 [MB/s] - * RAID6 sse2 2082 [MB/s] - * RAID6 sse2ext 2481 [MB/s] - * RAIDZ3 int32 236 [MB/s] - * RAIDZ3 int64 456 [MB/s] - * RAIDZ3 mmx 576 [MB/s] - * RAIDZ3 sse2 1109 [MB/s] - * RAIDZ3 sse2ext 1527 [MB/s] - * RAIDZ3 ssse3 931 [MB/s] (slower than sse2ext) - * RAIDZ3 ssse3ext 932 [MB/s] (slower than sse2ext) - * RAIDZ4 int32 144 [MB/s] - * RAIDZ4 int64 271 [MB/s] - * RAIDZ4 mmx 431 [MB/s] - * RAIDZ4 sse2 843 [MB/s] - * RAIDZ4 sse2ext 1086 [MB/s] - * RAIDZ4 ssse3 732 [MB/s] (slower than sse2ext) - * RAIDZ4 ssse3ext 571 [MB/s] (slower than sse2ext) + * PAR1 int32 1800 [MB/s] + * PAR1 int64 2938 [MB/s] + * PAR1 mmx 2946 [MB/s] + * PAR1 sse2 3429 [MB/s] + * PAR1 sse2ext 3447 [MB/s] + * PAR2 int32 519 [MB/s] + * PAR2 int64 944 [MB/s] + * PAR2 mmx 1160 [MB/s] + * PAR2 sse2 2082 [MB/s] + * PAR2 sse2ext 2481 [MB/s] + * PAR3z int32 236 [MB/s] + * PAR3z int64 456 [MB/s] + * PAR3z mmx 576 [MB/s] + * PAR3z sse2 1109 [MB/s] + * PAR3z sse2ext 1527 [MB/s] + * PAR3z ssse3 931 [MB/s] (slower than sse2ext) + * PAR3z ssse3ext 932 [MB/s] (slower than sse2ext) + * PAR4z int32 144 [MB/s] + * PAR4z int64 271 [MB/s] + * PAR4z mmx 431 [MB/s] + * PAR4z sse2 843 [MB/s] + * PAR4z sse2ext 1086 [MB/s] + * PAR4z ssse3 732 [MB/s] (slower than sse2ext) + * PAR4z ssse3ext 571 [MB/s] (slower than sse2ext) */ if (family == 6 && model == 28) return 1; @@ -251,16 +251,16 @@ static inline int cpu_has_slowextendedreg(void) * CRC intel-crc32 2845 [MB/s] * HASH Murmur3 2970 [MB/s] * HASH Spooky2 7503 [MB/s] - * RAID5 int32x2 4595 [MB/s] - * RAID5 mmxx2 5856 [MB/s] - * RAID5 mmxx4 6157 [MB/s] - * RAID5 sse2x2 7151 [MB/s] - * RAID5 sse2x4 8447 [MB/s] - * RAID5 sse2x8 8155 [MB/s] (slower than sse2x4) - * RAID6 int32x2 1892 [MB/s] - * RAID6 mmxx2 3744 [MB/s] - * RAID6 sse2x2 4922 [MB/s] - * RAID6 sse2x4 4464 [MB/s] (slower than sse2x2) + * PAR1 int32x2 4595 [MB/s] + * PAR1 mmxx2 5856 [MB/s] + * PAR1 mmxx4 6157 [MB/s] + * PAR1 sse2x2 7151 [MB/s] + * PAR1 sse2x4 8447 [MB/s] + * PAR1 sse2x8 8155 [MB/s] (slower than sse2x4) + * PAR2 int32x2 1892 [MB/s] + * PAR2 mmxx2 3744 [MB/s] + * PAR2 sse2x2 4922 [MB/s] + * PAR2 sse2x4 4464 [MB/s] (slower than sse2x2) */ if (family == 21) return 1; @@ -278,12 +278,12 @@ static inline int cpu_has_slowextendedreg(void) * memset0 34685 [MB/s] * Murmur3 4170 [MB/s] * Spooky2 2599 [MB/s] - * RAID5 int32x2 8919 [MB/s] - * RAID5 mmxx2 17170 [MB/s] - * RAID5 sse2x2 27478 [MB/s] - * RAID6 int32x2 1953 [MB/s] - * RAID6 mmxx2 7560 [MB/s] - * RAID6 sse2x2 13930 [MB/s] + * PAR1 int32x2 8919 [MB/s] + * PAR1 mmxx2 17170 [MB/s] + * PAR1 sse2x2 27478 [MB/s] + * PAR2 int32x2 1953 [MB/s] + * PAR2 mmxx2 7560 [MB/s] + * PAR2 sse2x2 13930 [MB/s] */ /* Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz @@ -293,12 +293,12 @@ static inline int cpu_has_slowextendedreg(void) * memset0 26164 [MB/s] * Murmur3 4469 [MB/s] * Spooky2 12834 [MB/s] - * RAID5 int32x2 10775 [MB/s] - * RAID5 mmxx2 19644 [MB/s] - * RAID5 sse2x2 29168 [MB/s] - * RAID6 int32x2 3288 [MB/s] - * RAID6 mmxx2 8374 [MB/s] - * RAID6 sse2x2 15547 [MB/s] + * PAR1 int32x2 10775 [MB/s] + * PAR1 mmxx2 19644 [MB/s] + * PAR1 sse2x2 29168 [MB/s] + * PAR2 int32x2 3288 [MB/s] + * PAR2 mmxx2 8374 [MB/s] + * PAR2 sse2x2 15547 [MB/s] */ /* Intel(R) Core(TM) i5 CPU 650 @ 3.20GHz @@ -308,12 +308,12 @@ static inline int cpu_has_slowextendedreg(void) * memset0 25468 [MB/s] * Murmur3 3357 [MB/s] * Spooky2 1861 [MB/s] - * RAID5 int32x2 5043 [MB/s] - * RAID5 mmxx2 9864 [MB/s] - * RAID5 sse2x2 16896 [MB/s] - * RAID6 int32x2 1100 [MB/s] - * RAID6 mmxx2 5056 [MB/s] - * RAID6 sse2x2 8726 [MB/s] + * PAR1 int32x2 5043 [MB/s] + * PAR1 mmxx2 9864 [MB/s] + * PAR1 sse2x2 16896 [MB/s] + * PAR2 int32x2 1100 [MB/s] + * PAR2 mmxx2 5056 [MB/s] + * PAR2 sse2x2 8726 [MB/s] */ /* AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ 1913.377 MHz @@ -323,12 +323,12 @@ static inline int cpu_has_slowextendedreg(void) * memset 2414 [MB/s] * Murmur3 1213 [MB/s] * Spooky2 947 [MB/s] - * RAID5 int32x2 532 [MB/s] - * RAID5 mmxx2 1121 [MB/s] - * RAID5 sse2x2 2061 [MB/s] - * RAID6 int32x2 280 [MB/s] - * RAID6 mmxx2 632 [MB/s] - * RAID6 sse2x2 909 [MB/s] + * PAR1 int32x2 532 [MB/s] + * PAR1 mmxx2 1121 [MB/s] + * PAR1 sse2x2 2061 [MB/s] + * PAR2 int32x2 280 [MB/s] + * PAR2 mmxx2 632 [MB/s] + * PAR2 sse2x2 909 [MB/s] */ /* ARM Feroceon 88FR131 rev 1 (v5l) @@ -338,8 +338,8 @@ static inline int cpu_has_slowextendedreg(void) * memset 763 [MB/s] * Murmur3 237 [MB/s] * Spooky2 216 [MB/s] - * RAID5 int32x2 233 [MB/s] - * RAID6 int32x2 103 [MB/s] + * PAR1 int32x2 233 [MB/s] + * PAR2 int32x2 103 [MB/s] */ /* Intel(R) Xeon(R) CPU E3-1270 V2 @ 3.50GHz $ @@ -349,12 +349,12 @@ static inline int cpu_has_slowextendedreg(void) * memset 27842 [MB/s] * Murmur3 4884 [MB/s] * Spooky2 14039 [MB/s] - * RAID5 int32x2 11038 [MB/s] - * RAID5 mmxx2 20055 [MB/s] - * RAID5 sse2x2 30703 [MB/s] - * RAID6 int32x2 3267 [MB/s] - * RAID6 mmxx2 8883 [MB/s] - * RAID6 sse2x2 16433 [MB/s] + * PAR1 int32x2 11038 [MB/s] + * PAR1 mmxx2 20055 [MB/s] + * PAR1 sse2x2 30703 [MB/s] + * PAR2 int32x2 3267 [MB/s] + * PAR2 mmxx2 8883 [MB/s] + * PAR2 sse2x2 16433 [MB/s] */ /* Bobcat/Zacade (info from x264 -> full family 20) @@ -365,12 +365,12 @@ static inline int cpu_has_slowextendedreg(void) * memset 2137 [MB/s] * Murmur3 1140 [MB/s] * Spooky2 2326 [MB/s] - * RAID5 int32x2 1853 [MB/s] - * RAID5 mmxx2 2019 [MB/s] - * RAID5 sse2x2 2908 [MB/s] - * RAID6 int32x2 884 [MB/s] - * RAID6 mmxx2 1502 [MB/s] - * RAID6 sse2x2 1168 [MB/s] (slow version with prefetchnta) + * PAR1 int32x2 1853 [MB/s] + * PAR1 mmxx2 2019 [MB/s] + * PAR1 sse2x2 2908 [MB/s] + * PAR2 int32x2 884 [MB/s] + * PAR2 mmxx2 1502 [MB/s] + * PAR2 sse2x2 1168 [MB/s] (slow version with prefetchnta) */ /* AMD Turion(tm) II Neo N40L Dual-Core Processor (info from user) @@ -380,13 +380,13 @@ static inline int cpu_has_slowextendedreg(void) * memset 4910 [MB/s] * Murmur3 1160 [MB/s] * Spooky2 3994 [MB/s] - * RAID5 int32x2 530 [MB/s] - * RAID5 mmxx2 1114 [MB/s] - * RAID5 sse2x1 2127 [MB/s] - * RAID5 sse2x2 2804 [MB/s] - * RAID6 int32x2 316 [MB/s] - * RAID6 mmxx2 655 [MB/s] - * RAID6 sse2x2 639 [MB/s] (slow version with prefetchnta) + * PAR1 int32x2 530 [MB/s] + * PAR1 mmxx2 1114 [MB/s] + * PAR1 sse2x1 2127 [MB/s] + * PAR1 sse2x2 2804 [MB/s] + * PAR2 int32x2 316 [MB/s] + * PAR2 mmxx2 655 [MB/s] + * PAR2 sse2x2 639 [MB/s] (slow version with prefetchnta) */ /* AMD Athlon(tm) II X4 620 (info from user) @@ -398,12 +398,12 @@ static inline int cpu_has_slowextendedreg(void) * Murmur3x64 3500 [MB/s] * Spooky2 4362 [MB/s] * Spooky2x86 4000 [MB/s] - * RAID5 int32x2 1064 [MB/s] - * RAID5 mmxx2 2064 [MB/s] - * RAID5 sse2x2 3289 [MB/s] - * RAID6 int32x2 639 [MB/s] - * RAID6 mmxx2 1325 [MB/s] - * RAID6 sse2x2 915 [MB/s] (slow version with prefetchnta) + * PAR1 int32x2 1064 [MB/s] + * PAR1 mmxx2 2064 [MB/s] + * PAR1 sse2x2 3289 [MB/s] + * PAR2 int32x2 639 [MB/s] + * PAR2 mmxx2 1325 [MB/s] + * PAR2 sse2x2 915 [MB/s] (slow version with prefetchnta) */ /* ARM @ 1.2GHz (info from user) @@ -426,8 +426,8 @@ static inline int cpu_has_slowextendedreg(void) * Murmur3 237 [MB/s] * Spooky2 216 [MB/s] * Spooky2x86 418 [MB/s] (dropped experiment of a new hash) - * RAID5 int32x2 233 [MB/s] - * RAID6 int32x2 103 [MB/s] + * PAR1 int32x2 233 [MB/s] + * PAR2 int32x2 103 [MB/s] */ #endif diff --git a/mktables.c b/mktables.c index 2b6e6bb5..c19c447d 100644 --- a/mktables.c +++ b/mktables.c @@ -271,7 +271,7 @@ int main(void) printf("\n"); } printf(" */\n"); - printf("const unsigned char __attribute__((aligned(256))) gfpower[%u][256] =\n", 3); + printf("const unsigned char __attribute__((aligned(256))) gfvandermonde[%u][256] =\n", 3); printf("{\n"); for(p=0;p<3;++p) { printf("\t{\n"); @@ -303,7 +303,7 @@ int main(void) printf("\n"); } printf(" */\n"); - printf("const unsigned char __attribute__((aligned(256))) gfgen[%u][256] =\n", PARITY); + printf("const unsigned char __attribute__((aligned(256))) gfcauchy[%u][256] =\n", PARITY); printf("{\n"); for(p=0;p 0 && level <= RAID_PARITY_S_MAX); + assert(level > 0 && level <= RAID_PARITY_CAUCHY_MAX); for(i=0;ilevel, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); /* compare the parity */ for(l=0;llevel;++l) { diff --git a/selftest.c b/selftest.c index 8b337044..3aff42e2 100644 --- a/selftest.c +++ b/selftest.c @@ -102,10 +102,10 @@ static void recovtest(unsigned mode, unsigned diskmax, unsigned block_size) unsigned level; raid_set(mode); - if (mode == RAID_MODE_S) - level = RAID_PARITY_S_MAX; + if (mode == RAID_MODE_CAUCHY) + level = RAID_PARITY_CAUCHY_MAX; else - level = RAID_PARITY_Z_MAX; + level = RAID_PARITY_VANDERMONDE_MAX; buffermax = diskmax + level * 2 + 2; @@ -134,31 +134,31 @@ static void recovtest(unsigned mode, unsigned diskmax, unsigned block_size) for(i=0;iautosave = 0; state->need_write = 0; state->block_size = 256 * 1024; /* default 256 KiB */ - state->raid_mode = RAID_MODE_S; + state->raid_mode = RAID_MODE_CAUCHY; for(l=0;lparity_path[l][0] = 0; state->parity_device[l] = 0; @@ -122,9 +122,9 @@ static void state_config_check(struct snapraid_state* state, const char* path, t unsigned l; /* check for parity level */ - if (state->raid_mode == RAID_MODE_Z) { - if (state->level > RAID_PARITY_Z_MAX) { - fprintf(stderr, "If you use the z-parity you cannot have more than %u parities.\n", RAID_PARITY_Z_MAX); + if (state->raid_mode == RAID_MODE_VANDERMONDE) { + if (state->level > RAID_PARITY_VANDERMONDE_MAX) { + fprintf(stderr, "If you use the z-parity you cannot have more than %u parities.\n", RAID_PARITY_VANDERMONDE_MAX); exit(EXIT_FAILURE); } } @@ -283,7 +283,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t #if defined(__i386__) || defined(__x86_64__) if (!cpu_has_ssse3()) #endif - if (state->raid_mode == RAID_MODE_S) { + if (state->raid_mode == RAID_MODE_CAUCHY) { if (state->level == 3) { fprintf(stderr, "WARNING! Your CPU doesn't have a fast implementation for triple parity.\n"); fprintf(stderr, "WARNING! It's recommended to switch to 'z-parity' instead than 'r-parity'.\n"); @@ -405,7 +405,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co case 'u' : l = 5; break; case 'z' : l = 2; - state->raid_mode = RAID_MODE_Z; + state->raid_mode = RAID_MODE_VANDERMONDE; break; default: fprintf(stderr, "Invalid '%s' specification in '%s' at line %u\n", tag, path, line); @@ -789,12 +789,6 @@ static void state_map(struct snapraid_state* state) ++hole; } - if (hole > 255) { - /* RAID6 P/Q parity works for up to 255 drives, no more */ - fprintf(stderr, "Too many disks. No more than 255.\n"); - exit(EXIT_FAILURE); - } - /* insert the new mapping */ map = map_alloc(disk->name, hole, ""); @@ -879,10 +873,10 @@ static void state_map(struct snapraid_state* state) } else if (diskcount >= 27 && state->level < 5) { fprintf(stderr, "WARNING! With %u disks it's recommended to use five parity levels.\n", diskcount); } else if (diskcount >= 20 && state->level < 4) { - fprintf(stderr, "WARNING! With %u disks it's recommended to use four parity leveles.\n", diskcount); + fprintf(stderr, "WARNING! With %u disks it's recommended to use four parity levels.\n", diskcount); } else if (diskcount >= 13 && state->level < 3) { fprintf(stderr, "WARNING! With %u disks it's recommended to use three parity levels.\n", diskcount); - } else if (diskcount >= 6 && state->level < 2) { + } else if (diskcount >= 5 && state->level < 2) { fprintf(stderr, "WARNING! With %u disks it's recommended to use two parity levels.\n", diskcount); } } diff --git a/state.h b/state.h index 00225a3b..e8c26ba7 100644 --- a/state.h +++ b/state.h @@ -95,7 +95,7 @@ struct snapraid_state { unsigned char hashseed[HASH_SIZE]; /**< Hash seed. Just after a uint64 to provide a minimal alignment. */ unsigned char prevhashseed[HASH_SIZE]; /**< Previous hash seed. In case of rehash. */ char lockfile[PATH_MAX]; /**< Path of the lock file to use. */ - unsigned level; /**< Number of parity levels. 1 for RAID5, 2 for RAID6. */ + unsigned level; /**< Number of parity levels. 1 for PAR1, 2 for PAR2. */ unsigned hash; /**< Hash kind used. */ unsigned prevhash; /**< Previous hash kind used. In case of rehash. */ unsigned besthash; /**< Best hash suggested. */ diff --git a/sync.c b/sync.c index 44b23e67..3ef0c217 100644 --- a/sync.c +++ b/sync.c @@ -381,7 +381,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari /* updates the parity only if really needed */ if (parity_needs_to_be_updated) { /* compute the parity */ - raid_gen(state->level, buffer, diskmax, state->block_size); + raid_par(state->level, buffer, diskmax, state->block_size); /* write the parity */ for(l=0;llevel;++l) { diff --git a/tables.h b/tables.h index 7c4d91fc..7d74157c 100644 --- a/tables.h +++ b/tables.h @@ -8804,7 +8804,7 @@ const unsigned char __attribute__((aligned(256))) gfinv[256] = * 01 02 04 08 10 20 40 80 1d 3a 74 e8 cd 87 13 26 4c 98 2d 5a b4 75 ea c9 8f 03 06 0c 18 30 60 c0 9d 27 4e 9c 25 4a 94 35 6a d4 b5 77 ee c1 9f 23 46 8c 05 0a 14 28 50 a0 5d ba 69 d2 b9 6f de a1 5f be 61 c2 99 2f 5e bc 65 ca 89 0f 1e 3c 78 f0 fd e7 d3 bb 6b d6 b1 7f fe e1 df a3 5b b6 71 e2 d9 af 43 86 11 22 44 88 0d 1a 34 68 d0 bd 67 ce 81 1f 3e 7c f8 ed c7 93 3b 76 ec c5 97 33 66 cc 85 17 2e 5c b8 6d da a9 4f 9e 21 42 84 15 2a 54 a8 4d 9a 29 52 a4 55 aa 49 92 39 72 e4 d5 b7 73 e6 d1 bf 63 c6 91 3f 7e fc e5 d7 b3 7b f6 f1 ff e3 db ab 4b 96 31 62 c4 95 37 6e dc a5 57 ae 41 82 19 32 64 c8 8d 07 0e 1c 38 70 e0 dd a7 53 a6 51 a2 59 b2 79 f2 f9 ef c3 9b 2b 56 ac 45 8a 09 12 24 48 90 3d 7a f4 f5 f7 f3 fb eb cb 8b 0b 16 2c 58 b0 7d fa e9 cf 83 1b 36 6c * 01 8e 47 ad d8 6c 36 1b 83 cf e9 fa 7d b0 58 2c 16 0b 8b cb eb fb f3 f7 f5 f4 7a 3d 90 48 24 12 09 8a 45 ac 56 2b 9b c3 ef f9 f2 79 b2 59 a2 51 a6 53 a7 dd e0 70 38 1c 0e 07 8d c8 64 32 19 82 41 ae 57 a5 dc 6e 37 95 c4 62 31 96 4b ab db e3 ff f1 f6 7b b3 d7 e5 fc 7e 3f 91 c6 63 bf d1 e6 73 b7 d5 e4 72 39 92 49 aa 55 a4 52 29 9a 4d a8 54 2a 15 84 42 21 9e 4f a9 da 6d b8 5c 2e 17 85 cc 66 33 97 c5 ec 76 3b 93 c7 ed f8 7c 3e 1f 81 ce 67 bd d0 68 34 1a 0d 88 44 22 11 86 43 af d9 e2 71 b6 5b a3 df e1 fe 7f b1 d6 6b bb d3 e7 fd f0 78 3c 1e 0f 89 ca 65 bc 5e 2f 99 c2 61 be 5f a1 de 6f b9 d2 69 ba 5d a0 50 28 14 0a 05 8c 46 23 9f c1 ee 77 b5 d4 6a 35 94 4a 25 9c 4e 27 9d c0 60 30 18 0c 06 03 8f c9 ea 75 b4 5a 2d 98 4c 26 13 87 cd e8 74 3a 1d 80 40 20 */ -const unsigned char __attribute__((aligned(256))) gfpower[3][256] = +const unsigned char __attribute__((aligned(256))) gfvandermonde[3][256] = { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, @@ -8921,7 +8921,7 @@ const unsigned char __attribute__((aligned(256))) gfpower[3][256] = * 01 97 7f 9c 7c 18 bd a2 58 1a da 74 70 a3 e5 47 29 07 f5 80 23 e9 fa 46 54 a0 99 95 53 9b 0b c7 09 c0 78 89 92 e3 0d b0 2a 8c fb 17 3f 26 65 87 27 5c 66 61 79 4d 32 b3 8d 52 e2 82 3d f9 c5 02 bc 4c 73 48 62 af ba 41 d9 c4 2f b1 33 b8 15 7d cf 3a a9 5f 84 6d 34 1b 44 94 72 81 42 be cc 4b 0a 6f 5a 22 36 b5 3c 9d 13 7e 08 dd d6 5e 04 fc 5b ec ef f1 6e 1e 77 24 e6 c6 aa cb fd 51 67 06 6a 4a 88 db b2 c2 5d 43 40 f7 50 a8 f2 7a 71 a4 d2 bf 31 90 19 9a 8e f6 c3 a6 e7 60 12 ee 2d de 38 e8 b7 98 c1 28 f3 05 96 63 d1 b9 14 9f 1d 83 68 75 ed 16 03 ce e4 df e0 10 ae 69 55 91 2e 4e fe 21 1f 9e e1 d5 cd ca f0 8b 2b c9 8a 93 bb 57 20 86 1c a1 4f 3e 25 d4 6c a5 6b a7 37 ff 39 35 0c f8 ea 56 45 8f 2c 59 ab 85 eb 49 0f dc d8 76 b6 f4 0e 11 b4 d0 30 d3 3b ad d7 * 01 2b 3f cf 73 2c d6 ed cb 74 15 78 8a c1 17 c9 89 68 21 ab 76 3b 4b 5a 6e 0e b9 d3 b6 3e 36 86 bf a2 a7 30 14 eb c7 2d 96 67 20 b5 9a e0 a8 c6 80 04 8d fe 75 5e 23 ca 8f 48 99 0d df 8e b8 70 29 9c 44 69 3d a5 c2 90 d2 1c 9b 02 1d 98 93 ec 84 e8 64 4c 3a 8b 97 f3 e5 c0 7d 26 c8 08 a0 62 82 55 f7 33 f6 51 63 4d 77 da fd c3 38 6d ee 09 47 a3 05 de a6 f1 22 25 6a 0c 81 b2 6b 58 d5 b3 fc fb 28 7f 07 dc 7a 9e d0 37 b4 e1 1a 24 03 ae 94 ba 88 2f ea 2e 8c 5b bb 79 d1 11 ff a4 19 3c 2a 4e 52 e3 95 bd 31 5d 35 4a 41 c4 db 42 c5 0b 49 1b 7c e4 b0 9d 45 f0 a9 61 57 06 d4 40 91 56 13 fa 87 ac 27 54 dd 59 1f 71 39 43 6c f9 be 4f f4 1e 32 cd e9 7e 7b 66 5f ef e7 6f 0a 60 d7 b7 83 92 e2 af 72 f8 b1 50 10 ce 18 53 a1 cc ad 12 34 0f f5 aa 16 e6 f2 d8 85 9f bc */ -const unsigned char __attribute__((aligned(256))) gfgen[6][256] = +const unsigned char __attribute__((aligned(256))) gfcauchy[6][256] = { { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, diff --git a/test-raid5.conf b/test-par1.conf similarity index 100% rename from test-raid5.conf rename to test-par1.conf diff --git a/test-raid6.conf b/test-par2.conf similarity index 100% rename from test-raid6.conf rename to test-par2.conf diff --git a/test-raidS3.conf b/test-par3.conf similarity index 100% rename from test-raidS3.conf rename to test-par3.conf diff --git a/test-raidS4.conf b/test-par4.conf similarity index 100% rename from test-raidS4.conf rename to test-par4.conf diff --git a/test-raidS5.conf b/test-par5.conf similarity index 100% rename from test-raidS5.conf rename to test-par5.conf diff --git a/test-raidS6-hole.conf b/test-par6-hole.conf similarity index 100% rename from test-raidS6-hole.conf rename to test-par6-hole.conf diff --git a/test-raidS6.conf b/test-par6.conf similarity index 100% rename from test-raidS6.conf rename to test-par6.conf diff --git a/util.c b/util.c index 4a2d268e..3a9444c7 100644 --- a/util.c +++ b/util.c @@ -1360,15 +1360,15 @@ void* malloc_nofail_align(size_t size, void** freeptr) * * With displacement (8 buffers, icore5, 32 bit): * - * RAID5 sse2x4 21936 [MB/s] - * RAID6 sse2x2 11902 [MB/s] - * RAIDZ3 sse2x1 5838 [MB/s] + * PAR1 sse2x4 21936 [MB/s] + * PAR2 sse2x2 11902 [MB/s] + * PAR3z sse2x1 5838 [MB/s] * * Without displacement: * - * RAID5 sse2x4 15368 [MB/s] - * RAID6 sse2x2 6814 [MB/s] - * RAIDZ3 sse2x1 3033 [MB/s] + * PAR1 sse2x4 15368 [MB/s] + * PAR2 sse2x2 6814 [MB/s] + * PAR3z sse2x1 3033 [MB/s] */ #define MALLOC_DISPLACEMENT (7*256)