From: William Lee Irwin III <wli@holomorphy.com>
To: Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: [2/2] move user-related stuff to linux/user.h
Date: Wed, 25 Aug 2004 11:03:42 -0700 [thread overview]
Message-ID: <20040825180342.GB2793@holomorphy.com> (raw)
In-Reply-To: <20040825180138.GA2793@holomorphy.com>
On Wed, Aug 25, 2004 at 11:01:38AM -0700, William Lee Irwin III wrote:
> I hereby declare open season on linux/sched.h!
> In preparation for moving all user-related bits out of sched.h and
> coopting linux/user.h for this purpose, this patch converts all
> inclusions of linux/user.h to asm/user.h
> The #error in linux/user.h is blown away by the successor to this
> patch, which fills it in with user-related bits split off from sched.h.
> vs. 2.6.8.1-mm4
This patch moves all user bits from linux/sched.h to linux/user.h and
sweeps all files fiddling with users.
Index: mm4-2.6.8.1/include/linux/init_task.h
===================================================================
--- mm4-2.6.8.1.orig/include/linux/init_task.h 2004-08-23 16:11:19.000000000 -0700
+++ mm4-2.6.8.1/include/linux/init_task.h 2004-08-25 10:04:12.546839624 -0700
@@ -2,6 +2,7 @@
#define _LINUX__INIT_TASK_H
#include <linux/file.h>
+#include <linux/user.h>
#include <asm/resource.h>
#define INIT_FILES \
Index: mm4-2.6.8.1/include/linux/key.h
===================================================================
--- mm4-2.6.8.1.orig/include/linux/key.h 2004-08-23 16:11:14.000000000 -0700
+++ mm4-2.6.8.1/include/linux/key.h 2004-08-25 10:04:48.598358960 -0700
@@ -59,6 +59,7 @@
struct key_owner;
struct keyring_list;
struct keyring_name;
+struct user_struct;
/*****************************************************************************/
/*
Index: mm4-2.6.8.1/include/linux/sched.h
===================================================================
--- mm4-2.6.8.1.orig/include/linux/sched.h 2004-08-25 09:54:27.149833496 -0700
+++ mm4-2.6.8.1/include/linux/sched.h 2004-08-25 10:02:20.833822584 -0700
@@ -334,32 +334,7 @@
#define rt_task(p) (unlikely((p)->prio < MAX_RT_PRIO))
-/*
- * Some day this will be a full-fledged user tracking system..
- */
-struct user_struct {
- atomic_t __count; /* reference count */
- atomic_t processes; /* How many processes does this user have? */
- atomic_t files; /* How many open files does this user have? */
- atomic_t sigpending; /* How many pending signals does this user have? */
- /* protected by mq_lock */
- unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
- unsigned long locked_shm; /* How many pages of mlocked shm ? */
-
-#ifdef CONFIG_KEYS
- struct key *uid_keyring; /* UID specific keyring */
- struct key *session_keyring; /* UID's default session keyring */
-#endif
-
- /* Hash table maintenance information */
- struct list_head uidhash_list;
- uid_t uid;
-};
-
-extern struct user_struct *find_user(uid_t);
-
-extern struct user_struct root_user;
-#define INIT_USER (&root_user)
+struct user_struct;
typedef struct prio_array prio_array_t;
struct backing_dev_info;
@@ -698,16 +673,6 @@
extern void set_special_pids(pid_t session, pid_t pgrp);
extern void __set_special_pids(pid_t session, pid_t pgrp);
-/* per-UID process charging. */
-extern struct user_struct * alloc_uid(uid_t);
-static inline struct user_struct *get_uid(struct user_struct *u)
-{
- atomic_inc(&u->__count);
- return u;
-}
-extern void free_uid(struct user_struct *);
-extern void switch_uid(struct user_struct *);
-
#include <asm/current.h>
extern unsigned long itimer_ticks;
Index: mm4-2.6.8.1/include/linux/user.h
===================================================================
--- mm4-2.6.8.1.orig/include/linux/user.h 2004-08-25 09:54:39.896895648 -0700
+++ mm4-2.6.8.1/include/linux/user.h 2004-08-25 10:07:11.597619768 -0700
@@ -1 +1,41 @@
-#error do not include this header
+#ifndef _LINUX_USER_H
+#define _LINUX_USER_H
+
+/*
+ * Some day this will be a full-fledged user tracking system..
+ */
+struct user_struct {
+ atomic_t __count; /* reference count */
+ atomic_t processes; /* How many processes does this user have? */
+ atomic_t files; /* How many open files does this user have? */
+ atomic_t sigpending; /* How many pending signals does this user have? */
+ /* protected by mq_lock */
+ unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
+ unsigned long locked_shm; /* How many pages of mlocked shm ? */
+
+#ifdef CONFIG_KEYS
+ struct key *uid_keyring; /* UID specific keyring */
+ struct key *session_keyring; /* UID's default session keyring */
+#endif
+
+ /* Hash table maintenance information */
+ struct list_head uidhash_list;
+ uid_t uid;
+};
+
+#define INIT_USER (&root_user)
+extern struct user_struct root_user;
+
+/* per-UID process charging. */
+struct user_struct *find_user(uid_t);
+struct user_struct *alloc_uid(uid_t);
+void free_uid(struct user_struct *);
+void switch_uid(struct user_struct *);
+
+static inline struct user_struct *get_uid(struct user_struct *u)
+{
+ atomic_inc(&u->__count);
+ return u;
+}
+
+#endif /* _LINUX_USER_H */
Index: mm4-2.6.8.1/ipc/mqueue.c
===================================================================
--- mm4-2.6.8.1.orig/ipc/mqueue.c 2004-08-23 16:11:12.000000000 -0700
+++ mm4-2.6.8.1/ipc/mqueue.c 2004-08-25 10:05:14.862366224 -0700
@@ -22,6 +22,7 @@
#include <linux/msg.h>
#include <linux/skbuff.h>
#include <linux/netlink.h>
+#include <linux/user.h>
#include <net/sock.h>
#include "util.h"
Index: mm4-2.6.8.1/kernel/exit.c
===================================================================
--- mm4-2.6.8.1.orig/kernel/exit.c 2004-08-23 16:11:20.000000000 -0700
+++ mm4-2.6.8.1/kernel/exit.c 2004-08-25 10:05:25.034819776 -0700
@@ -27,6 +27,7 @@
#include <linux/cpuset.h>
#include <linux/perfctr.h>
#include <linux/cpu.h>
+#include <linux/user.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
Index: mm4-2.6.8.1/kernel/fork.c
===================================================================
--- mm4-2.6.8.1.orig/kernel/fork.c 2004-08-25 09:54:39.834905072 -0700
+++ mm4-2.6.8.1/kernel/fork.c 2004-08-25 10:05:34.743343856 -0700
@@ -41,6 +41,7 @@
#include <linux/profile.h>
#include <linux/rmap.h>
#include <linux/hash.h>
+#include <linux/user.h>
#include <asm/pgtable.h>
#include <asm/pgalloc.h>
Index: mm4-2.6.8.1/kernel/signal.c
===================================================================
--- mm4-2.6.8.1.orig/kernel/signal.c 2004-08-23 16:11:19.000000000 -0700
+++ mm4-2.6.8.1/kernel/signal.c 2004-08-25 10:05:46.339580960 -0700
@@ -21,6 +21,7 @@
#include <linux/binfmts.h>
#include <linux/security.h>
#include <linux/ptrace.h>
+#include <linux/user.h>
#include <asm/param.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
Index: mm4-2.6.8.1/kernel/sys.c
===================================================================
--- mm4-2.6.8.1.orig/kernel/sys.c 2004-08-23 16:11:19.000000000 -0700
+++ mm4-2.6.8.1/kernel/sys.c 2004-08-25 10:05:56.775994384 -0700
@@ -26,6 +26,7 @@
#include <linux/dcookies.h>
#include <linux/suspend.h>
#include <linux/key.h>
+#include <linux/user.h>
#include <asm/uaccess.h>
#include <asm/io.h>
Index: mm4-2.6.8.1/kernel/user.c
===================================================================
--- mm4-2.6.8.1.orig/kernel/user.c 2004-08-23 16:11:14.000000000 -0700
+++ mm4-2.6.8.1/kernel/user.c 2004-08-25 10:08:24.277570736 -0700
@@ -13,6 +13,7 @@
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/key.h>
+#include <linux/user.h>
/*
* UID task count cache, to get fast user lookup in "alloc_uid"
Index: mm4-2.6.8.1/mm/mlock.c
===================================================================
--- mm4-2.6.8.1.orig/mm/mlock.c 2004-08-23 16:11:13.000000000 -0700
+++ mm4-2.6.8.1/mm/mlock.c 2004-08-25 10:06:06.915452952 -0700
@@ -7,7 +7,7 @@
#include <linux/mman.h>
#include <linux/mm.h>
-
+#include <linux/user.h>
static int mlock_fixup(struct vm_area_struct * vma,
unsigned long start, unsigned long end, unsigned int newflags)
Index: mm4-2.6.8.1/security/keys/key.c
===================================================================
--- mm4-2.6.8.1.orig/security/keys/key.c 2004-08-23 16:11:14.000000000 -0700
+++ mm4-2.6.8.1/security/keys/key.c 2004-08-25 10:06:18.519688840 -0700
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/err.h>
+#include <linux/user.h>
#include "internal.h"
static kmem_cache_t *key_jar;
Index: mm4-2.6.8.1/security/keys/process_keys.c
===================================================================
--- mm4-2.6.8.1.orig/security/keys/process_keys.c 2004-08-23 16:11:14.000000000 -0700
+++ mm4-2.6.8.1/security/keys/process_keys.c 2004-08-25 10:06:30.147921080 -0700
@@ -16,6 +16,7 @@
#include <linux/prctl.h>
#include <linux/fs.h>
#include <linux/err.h>
+#include <linux/user.h>
#include <asm/uaccess.h>
#include "internal.h"
next prev parent reply other threads:[~2004-08-25 18:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-19 14:39 includes cleanup Dave Jones
2004-08-19 14:49 ` Christoph Hellwig
2004-08-19 14:54 ` Dave Jones
2004-08-19 16:50 ` Dave Jones
2004-08-19 15:06 ` William Lee Irwin III
2004-08-25 18:01 ` [1/2] convert linux/user.h users to asm/user.h William Lee Irwin III
2004-08-25 18:03 ` William Lee Irwin III [this message]
2004-08-25 19:39 ` [0/4] remove signal.h from sched.h William Lee Irwin III
2004-08-25 19:40 ` [1/4] move sighand_struct to signal.h William Lee Irwin III
2004-08-25 19:42 ` [1/4] move sigqueue " William Lee Irwin III
2004-08-25 19:43 ` [2/4] move sigpending to sched.h William Lee Irwin III
2004-08-25 19:44 ` [3/4] move sighand to signal.h William Lee Irwin III
2004-08-25 19:45 ` [4/4] move signal_struct " William Lee Irwin III
2004-08-25 21:10 ` [5/4] move most signal functions " William Lee Irwin III
2004-08-25 23:56 ` [patch *] remove 450 unnecessary #includes of sched.h Tim Schmielau
2004-08-20 15:05 ` includes cleanup Tim Schmielau
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=20040825180342.GB2793@holomorphy.com \
--to=wli@holomorphy.com \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.