public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steven J. Hill" <Steve.Hill@timesys.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2.6] Make linux/swap.h usable by userspace code.
Date: Mon, 01 Mar 2004 09:32:47 -0500	[thread overview]
Message-ID: <4043498F.7050101@timesys.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 141 bytes --]

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

[-- Attachment #2: linux-2.6-swap.h.patch --]
[-- Type: text/x-patch, Size: 1717 bytes --]

--- linux/include/linux/swap.h	Thu Feb  5 17:46:32 2004
+++ linux-new/include/linux/swap.h	Mon Mar  1 09:00:35 2004
@@ -2,6 +2,20 @@
 #define _LINUX_SWAP_H
 
 #include <linux/config.h>
+
+/*
+ * MAX_SWAPFILES defines the maximum number of swaptypes: things which can
+ * be swapped to.  The swap type and the offset into that swap type are
+ * encoded into pte's and into pgoff_t's in the swapcache.  Using five bits
+ * for the type means that the maximum number of swapcache pages is 27 bits
+ * on 32-bit-pgoff_t architectures.  And that assumes that the architecture packs
+ * the type/offset into the pte as 5/27 as well.
+ */
+#define MAX_SWAPFILES_SHIFT	5
+#define MAX_SWAPFILES		(1 << MAX_SWAPFILES_SHIFT)
+
+#ifdef __KERNEL__
+
 #include <linux/spinlock.h>
 #include <linux/linkage.h>
 #include <linux/mmzone.h>
@@ -20,17 +34,6 @@
 }
 
 /*
- * MAX_SWAPFILES defines the maximum number of swaptypes: things which can
- * be swapped to.  The swap type and the offset into that swap type are
- * encoded into pte's and into pgoff_t's in the swapcache.  Using five bits
- * for the type means that the maximum number of swapcache pages is 27 bits
- * on 32-bit-pgoff_t architectures.  And that assumes that the architecture packs
- * the type/offset into the pte as 5/27 as well.
- */
-#define MAX_SWAPFILES_SHIFT	5
-#define MAX_SWAPFILES		(1 << MAX_SWAPFILES_SHIFT)
-
-/*
  * 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)
  * swap area format, the second part of the union adds - in the
@@ -72,8 +75,6 @@
 struct reclaim_state {
 	unsigned long reclaimed_slab;
 };
-
-#ifdef __KERNEL__
 
 struct address_space;
 struct pte_chain;

             reply	other threads:[~2004-03-01 14:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01 14:32 Steven J. Hill [this message]
2004-03-01 14:36 ` [PATCH 2.6] Make linux/swap.h usable by userspace code Christoph Hellwig
2004-03-01 14:40   ` Steven J. Hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4043498F.7050101@timesys.com \
    --to=steve.hill@timesys.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox