From: Chris Wright Add simple helper function to grab a reference to a user_struct. --- 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-18 18:31:52.818827040 -0700 +++ 25-akpm/include/linux/sched.h 2004-05-18 18:31:52.821826584 -0700 @@ -756,6 +756,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 *); _