[PATCH 1/1] Unionfs: move poison #define into poison.h

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <randy.dunlap@...>, <akpm@...>, <unionfs@...>, <linux-kernel@...>, <ezk@...>
Cc: <ezk@...>, Josef 'Jeff' Sipek <jsipek@...>
Date: Tuesday, September 25, 2007 - 1:45 pm

This also fixes a compile warning on 64-bit systems.

Cc: ezk@cs.sunysb.edu
Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
---
 fs/unionfs/debug.c     |   12 ++----------
 fs/unionfs/union.h     |    1 +
 include/linux/poison.h |    3 +++
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
index f678534..aa6a76a 100644
--- a/fs/unionfs/debug.c
+++ b/fs/unionfs/debug.c
@@ -25,14 +25,6 @@
 		}							\
 	} while (0)
 
-#if BITS_PER_LONG == 32
-#define POISONED_PTR		((void*) 0x5a5a5a5a)
-#elif BITS_PER_LONG == 64
-#define POISONED_PTR		((void*) 0x5a5a5a5a5a5a5a5a)
-#else
-#error Unknown BITS_PER_LONG value
-#endif /* BITS_PER_LONG != known */
-
 /*
  * __unionfs_check_{inode,dentry,file} perform exhaustive sanity checking on
  * the fan-out of various Unionfs objects.  We check that no lower objects
@@ -93,7 +85,7 @@ void __unionfs_check_inode(const struct inode *inode,
 				printk(" Ci5: inode/linode=%p:%p bindex=%d "
 				       "istart/end=%d:%d\n", inode,
 				       lower_inode, bindex, istart, iend);
-			} else if (lower_inode == POISONED_PTR) {
+			} else if (lower_inode == UNIONFS_POISONED_PTR) {
 				/* freed inode! */
 				PRINT_CALLER(fname, fxn, line);
 				printk(" Ci6: inode/linode=%p:%p bindex=%d "
@@ -261,7 +253,7 @@ void __unionfs_check_dentry(const struct dentry *dentry,
 				printk(" CI5: dentry/linode=%p:%p bindex=%d "
 				       "istart/end=%d:%d\n", dentry,
 				       lower_inode, bindex, istart, iend);
-			} else if (lower_inode == POISONED_PTR) {
+			} else if (lower_inode == UNIONFS_POISONED_PTR) {
 				/* freed inode! */
 				PRINT_CALLER(fname, fxn, line);
 				printk(" CI6: dentry/linode=%p:%p bindex=%d "
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 9ec5f82..3b6881a 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -43,6 +43,7 @@
 #include <linux/fs_stack.h>
 #include <linux/magic.h>
 #include <linux/log2.h>
+#include <linux/poison.h>
 
 #include <asm/mman.h>
 #include <asm/system.h>
diff --git a/include/linux/poison.h b/include/linux/poison.h
index d93c300..c81118b 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -38,6 +38,9 @@
 /********** fs/jbd/journal.c **********/
 #define JBD_POISON_FREE	0x5b
 
+/********** fs/unionfs/debug.c **********/
+#define UNIONFS_POISONED_PTR	((void *) 0x75757575)
+
 /********** drivers/base/dmapool.c **********/
 #define	POOL_POISON_FREED	0xa7	/* !inuse */
 #define	POOL_POISON_ALLOCATED	0xa9	/* !initted */
-- 
1.5.2.2.238.g7cbf2f2

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.23-rc8-mm1, Andrew Morton, (Tue Sep 25, 4:46 am)
black screen after kill X [Was: 2.6.23-rc8-mm1], Jiri Slaby, (Wed Sep 26, 3:51 am)
Re: 2.6.23-rc8-mm1 : wgt634u.c, trem, (Tue Sep 25, 6:23 pm)
Re: 2.6.23-rc8-mm1, Badari Pulavarty, (Tue Sep 25, 6:05 pm)
Re: 2.6.23-rc8-mm1, Andy Whitcroft, (Wed Sep 26, 8:28 am)
Re: 2.6.23-rc8-mm1: drivers/kvm/ioapic.o build failure, Mariusz Kozlowski, (Tue Sep 25, 4:56 pm)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, Kamalesh Babulal, (Tue Sep 25, 4:00 pm)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, KAMEZAWA Hiroyuki, (Tue Sep 25, 9:32 pm)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, KAMEZAWA Hiroyuki, (Tue Sep 25, 9:48 pm)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, Kamalesh Babulal, (Wed Sep 26, 4:19 am)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, Badari Pulavarty, (Tue Sep 25, 6:01 pm)
Re: 2.6.23-rc8-mm1 - powerpc memory hotplug link failure, Kamalesh Babulal, (Wed Sep 26, 4:18 am)
Re: 2.6.23-rc8-mm1, Randy Dunlap, (Tue Sep 25, 1:26 pm)
[PATCH 1/1] Unionfs: move poison #define into poison.h, Josef 'Jeff' Sipek, (Tue Sep 25, 1:45 pm)
Re: [PATCH 1/1] Unionfs: move poison #define into poison.h, Josef 'Jeff' Sipek, (Tue Sep 25, 9:02 pm)
Re: 2.6.23-rc8-mm1, Josef Sipek, (Tue Sep 25, 1:39 pm)
2.6.23-rc8-mm1: unscrew UFS, Alexey Dobriyan, (Tue Sep 25, 3:02 pm)
2.6.23-rc8-mm1 -- powerpc link failure, Andy Whitcroft, (Tue Sep 25, 9:46 am)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Jiri Kosina, (Tue Sep 25, 11:23 am)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Andy Whitcroft, (Thu Sep 27, 8:03 am)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Jiri Kosina, (Thu Sep 27, 8:13 am)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Andrew Morton, (Thu Sep 27, 6:13 pm)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Jiri Kosina, (Thu Sep 27, 6:17 pm)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Andrew Morton, (Thu Sep 27, 1:13 pm)
Re: 2.6.23-rc8-mm1 -- powerpc link failure, Sam Ravnborg, (Thu Sep 27, 3:31 pm)
Re: 2.6.23-rc8-mm1 - drivers/net/ibm_newemac/mal - broken, Kamalesh Babulal, (Tue Sep 25, 8:53 am)
Re: 2.6.23-rc8-mm1 - drivers/net/ibm_newemac/mal - broken, Andrew Morton, (Tue Sep 25, 12:16 pm)
Re: 2.6.23-rc8-mm1, Kamalesh Babulal, (Tue Sep 25, 6:39 am)
Re: 2.6.23-rc8-mm1, Andrew Morton, (Tue Sep 25, 11:46 am)