summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Wegener <sven.wegener@stealer.net>2008-09-20 10:32:59 +0000
committerSven Wegener <sven.wegener@stealer.net>2009-04-11 14:07:42 +0000
commitcd7cbf5d8ab8447b6f4d5e061166ddadb1168627 (patch)
treebdedcf499c6c6c9b4ead1517f0565b33b5b95045
parentce54c967e02de65b8e32ec9136e72a8ea4642df5 (diff)
md: Fix user space raid6test application
This fixes the following build warning and error: raid6.h:152: warning: implicit declaration of function 'gettimeofday' raid6algos.c:105: undefined reference to `time_before' - Fix size calculation for free_pages() emulation - Remove additional files during make clean. Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
-rw-r--r--drivers/md/raid6.h9
-rw-r--r--drivers/md/raid6test/Makefile2
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/raid6.h b/drivers/md/raid6.h
index a01c620b98ff..a6b7cb2e6b71 100644
--- a/drivers/md/raid6.h
+++ b/drivers/md/raid6.h
@@ -124,11 +124,18 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb, void **ptrs
/* Some definitions to allow code to be compiled for testing in userspace */
#ifndef __KERNEL__
+#include <sys/time.h> /* for gettimeofday() */
+
# define jiffies raid6_jiffies()
# define printk printf
# define GFP_KERNEL 0
# define __get_free_pages(x,y) ((unsigned long)mmap(NULL, PAGE_SIZE << (y), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0))
-# define free_pages(x,y) munmap((void *)(x), (y)*PAGE_SIZE)
+# define free_pages(x,y) munmap((void *)(x), PAGE_SIZE << (y))
+
+static inline int time_before(unsigned long a, unsigned long b)
+{
+ return (long) a - (long) b < 0;
+}
static inline void cpu_relax(void)
{
diff --git a/drivers/md/raid6test/Makefile b/drivers/md/raid6test/Makefile
index 78e0396adf2a..b14f992afd44 100644
--- a/drivers/md/raid6test/Makefile
+++ b/drivers/md/raid6test/Makefile
@@ -69,7 +69,7 @@ raid6tables.c: mktables
./mktables > raid6tables.c
clean:
- rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test
+ rm -f *.o *.a mktables mktables.c raid6*.uc raid6*.c raid6test
spotless: clean
rm -f *~