<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: Chris Wright &lt;chrisw@osdl.org&gt;

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	Tue May 11 15:21:14 2004
+++ 25-akpm/include/linux/sched.h	Tue May 11 15:21:14 2004
@@ -757,6 +757,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(&amp;u-&gt;__count);
+	return u;
+}
 extern void free_uid(struct user_struct *);
 extern void switch_uid(struct user_struct *);
 

_
</pre></body></html>