public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] set_page_count
@ 2006-01-03 19:41 Avishay Traeger
  2006-01-03 20:03 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Avishay Traeger @ 2006-01-03 19:41 UTC (permalink / raw)
  To: linux-kernel

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 *));


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

end of thread, other threads:[~2006-01-03 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-03 19:41 [PATCH] set_page_count Avishay Traeger
2006-01-03 20:03 ` Jiri Slaby

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