diff options
| author | Chris Wright <chrisw@osdl.org> | 2004-06-17 17:57:07 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-17 17:57:07 -0700 |
| commit | 9d9f6e8b61400f3292be2a85b6aa84d3e47a60c8 (patch) | |
| tree | cfacbd604301f09fcf327a79f97a1f42e8341b00 | |
| parent | faaa0febefc3de14da204284d79dd60c59a140b2 (diff) | |
[PATCH] RLIM: add mq_bytes to user_struct
Add mq_bytes field to user_struct, and make sure it's properly initialized.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | include/linux/sched.h | 2 | ||||
| -rw-r--r-- | kernel/user.c | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index b81e02838224..0280fd490f73 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -315,6 +315,8 @@ struct user_struct { 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? */ /* Hash table maintenance information */ struct list_head uidhash_list; diff --git a/kernel/user.c b/kernel/user.c index 545e83fa9719..9f9859ef88ea 100644 --- a/kernel/user.c +++ b/kernel/user.c @@ -32,6 +32,7 @@ struct user_struct root_user = { .processes = ATOMIC_INIT(1), .files = ATOMIC_INIT(0), .sigpending = ATOMIC_INIT(0), + .mq_bytes = 0 }; /* @@ -111,6 +112,8 @@ struct user_struct * alloc_uid(uid_t uid) atomic_set(&new->files, 0); atomic_set(&new->sigpending, 0); + new->mq_bytes = 0; + /* * Before adding this, check whether we raced * on adding the same user already.. |
