lkml.org 
[lkml]   [2006]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] set_page_count
From
Date
Hello all,

I sent this to linux-mm, but haven't gotten a response - hope it's OK to
send here. 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? Anything
else I need to do?

Thanks,
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-03 20:44    [W:0.028 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site