* set_page_count() patch
@ 2006-01-03 16:40 Avishay Traeger
0 siblings, 0 replies; only message in thread
From: Avishay Traeger @ 2006-01-03 16:40 UTC (permalink / raw)
To: linux-mm
Hello all,
I believe the set_page_count() macro is broken, and should have
parentheses around the 'v' in the second argument (otherwise more
complex arguments will break). Here is a patch to 2.6.15 - I haven't
really tested it, but it looks simple enough. Any objections?
Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/
diff -Naur linux-2.6.15/include/linux/mm.h
linux-2.6.15-mod/include/linux/mm.h
--- linux-2.6.15/include/linux/mm.h 2006-01-02 22:21:10.000000000
-0500
+++ linux-2.6.15-mod/include/linux/mm.h 2006-01-03 11:28:19.000000000
-0500
@@ -308,7 +308,7 @@
*/
#define get_page_testone(p) atomic_inc_and_test(&(p)->_count)
-#define set_page_count(p,v) atomic_set(&(p)->_count, v - 1)
+#define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1)
#define __put_page(p) atomic_dec(&(p)->_count)
extern void FASTCALL(__page_cache_release(struct page *));
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-01-03 16:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-03 16:40 set_page_count() patch Avishay Traeger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox