diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-08-09 11:36:44 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-08-09 11:36:44 +0200 |
commit | 2144381da478cc4aa3a29ee29b0c5e6ddaaced14 (patch) | |
tree | 380a29fec86b537ed602d12f4050654b1c66c27c /lib/raid6/unroll.awk | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile (diff) | |
parent | async_tx: Move ASYNC_RAID6_TEST option to crypto/async_tx/, fix dependencies (diff) | |
download | linux-2144381da478cc4aa3a29ee29b0c5e6ddaaced14.tar.xz linux-2144381da478cc4aa3a29ee29b0c5e6ddaaced14.zip |
Merge branch 'async' of macbook:git/btrfs-unstable
Conflicts:
drivers/md/Makefile
lib/raid6/unroll.pl
Diffstat (limited to 'lib/raid6/unroll.awk')
-rw-r--r-- | lib/raid6/unroll.awk | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/raid6/unroll.awk b/lib/raid6/unroll.awk new file mode 100644 index 000000000000..c6aa03631df8 --- /dev/null +++ b/lib/raid6/unroll.awk @@ -0,0 +1,20 @@ + +# This filter requires one command line option of form -vN=n +# where n must be a decimal number. +# +# Repeat each input line containing $$ n times, replacing $$ with 0...n-1. +# Replace each $# with n, and each $* with a single $. + +BEGIN { + n = N + 0 +} +{ + if (/\$\$/) { rep = n } else { rep = 1 } + for (i = 0; i < rep; ++i) { + tmp = $0 + gsub(/\$\$/, i, tmp) + gsub(/\$\#/, n, tmp) + gsub(/\$\*/, "$", tmp) + print tmp + } +} |