From: Chris Wright Add simple helper function to grab a reference to a user_struct. Signed-off-by: Andrew Morton --- 25-akpm/include/linux/sched.h | 5 +++++ 1 files changed, 5 insertions(+) diff -puN include/linux/sched.h~rlim-add-simple-get_uid-helper include/linux/sched.h --- 25/include/linux/sched.h~rlim-add-simple-get_uid-helper 2004-05-25 22:10:02.667501240 -0700 +++ 25-akpm/include/linux/sched.h 2004-05-25 22:10:02.671500632 -0700 @@ -762,6 +762,11 @@ extern void __set_special_pids(pid_t ses /* 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 *); _