Skip to contentSkip to conversation

Make linux/swap.h usable by userspace code.

PATCH New Steven J. Hill 1 participant 1 message Mar 1, 2004 MM swap

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make linux/swap.h usable by userspace code.

Greetings.

This patch allows 'swap.h' to be included by userspace code. AFAIK the LTP suite is the only code that does this so far.

-Steve

include/linux/swap.h +6 -4
@@ -1,6 +1,12 @@
 #ifndef _LINUX_SWAP_H
 #define _LINUX_SWAP_H
 
+#include <linux/config.h>
+
+#define MAX_SWAPFILES 32
+
+#ifdef __KERNEL__
+
 #include <linux/spinlock.h>
 #include <asm/page.h>
 
@@ -8,8 +14,6 @@
 #define SWAP_FLAG_PRIO_MASK	0x7fff
 #define SWAP_FLAG_PRIO_SHIFT	0
 
-#define MAX_SWAPFILES 32
-
 /*
  * Magic header for a swap area. The first part of the union is
  * what the swap magic looks like for the old (limited to 128MB)
@@ -38,8 +42,6 @@
 		unsigned int badpages[1];
 	} info;
 };
-
-#ifdef __KERNEL__
 
 /*
  * Max bad pages in the new format..