public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* md: Fix userspace free_pages() macro
@ 2011-12-14 13:34 Steven Rostedt
  2011-12-14 21:15 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2011-12-14 13:34 UTC (permalink / raw)
  To: LKML; +Cc: NeilBrown, Dan Williams, H. Peter Anvin

While using etags to find free_pages(), I stumbled across this debug
definition of free_pages() that is to be used while debugging some raid
code in userspace. The __get_free_pages() allocates the correct size,
but the free_pages() does not match. free_pages(), like
__get_free_pages(), takes an order and not a size.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 2b59cc8..53272e9 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -132,7 +132,7 @@ void raid6_dual_recov(int disks, size_t bytes, int faila, int failb,
 						     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 void cpu_relax(void)
 {



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-15  5:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14 13:34 md: Fix userspace free_pages() macro Steven Rostedt
2011-12-14 21:15 ` H. Peter Anvin
2011-12-15  5:33   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox