This source file includes following definitions.
- get_uid
 
   1 
   2 #ifndef _LINUX_SCHED_USER_H
   3 #define _LINUX_SCHED_USER_H
   4 
   5 #include <linux/uidgid.h>
   6 #include <linux/atomic.h>
   7 #include <linux/refcount.h>
   8 #include <linux/ratelimit.h>
   9 
  10 
  11 
  12 
  13 struct user_struct {
  14         refcount_t __count;     
  15         atomic_t processes;     
  16         atomic_t sigpending;    
  17 #ifdef CONFIG_FANOTIFY
  18         atomic_t fanotify_listeners;
  19 #endif
  20 #ifdef CONFIG_EPOLL
  21         atomic_long_t epoll_watches; 
  22 #endif
  23 #ifdef CONFIG_POSIX_MQUEUE
  24         
  25         unsigned long mq_bytes; 
  26 #endif
  27         unsigned long locked_shm; 
  28         unsigned long unix_inflight;    
  29         atomic_long_t pipe_bufs;  
  30 
  31         
  32         struct hlist_node uidhash_node;
  33         kuid_t uid;
  34 
  35 #if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
  36     defined(CONFIG_NET) || defined(CONFIG_IO_URING)
  37         atomic_long_t locked_vm;
  38 #endif
  39 
  40         
  41         struct ratelimit_state ratelimit;
  42 };
  43 
  44 extern int uids_sysfs_init(void);
  45 
  46 extern struct user_struct *find_user(kuid_t);
  47 
  48 extern struct user_struct root_user;
  49 #define INIT_USER (&root_user)
  50 
  51 
  52 
  53 extern struct user_struct * alloc_uid(kuid_t);
  54 static inline struct user_struct *get_uid(struct user_struct *u)
  55 {
  56         refcount_inc(&u->__count);
  57         return u;
  58 }
  59 extern void free_uid(struct user_struct *);
  60 
  61 #endif