~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/sched/user.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  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/percpu_counter.h>
  8 #include <linux/refcount.h>
  9 #include <linux/ratelimit.h>
 10 
 11 /*
 12  * Some day this will be a full-fledged user tracking system..
 13  */
 14 struct user_struct {
 15         refcount_t __count;     /* reference count */
 16 #ifdef CONFIG_EPOLL
 17         struct percpu_counter epoll_watches; /* The number of file descriptors currently watched */
 18 #endif
 19         unsigned long unix_inflight;    /* How many files in flight in unix sockets */
 20         atomic_long_t pipe_bufs;  /* how many pages are allocated in pipe buffers */
 21 
 22         /* Hash table maintenance information */
 23         struct hlist_node uidhash_node;
 24         kuid_t uid;
 25 
 26 #if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
 27         defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
 28         defined(CONFIG_VFIO_PCI_ZDEV_KVM) || IS_ENABLED(CONFIG_IOMMUFD)
 29         atomic_long_t locked_vm;
 30 #endif
 31 #ifdef CONFIG_WATCH_QUEUE
 32         atomic_t nr_watches;    /* The number of watches this user currently has */
 33 #endif
 34 
 35         /* Miscellaneous per-user rate limit */
 36         struct ratelimit_state ratelimit;
 37 };
 38 
 39 extern int uids_sysfs_init(void);
 40 
 41 extern struct user_struct *find_user(kuid_t);
 42 
 43 extern struct user_struct root_user;
 44 #define INIT_USER (&root_user)
 45 
 46 
 47 /* per-UID process charging. */
 48 extern struct user_struct * alloc_uid(kuid_t);
 49 static inline struct user_struct *get_uid(struct user_struct *u)
 50 {
 51         refcount_inc(&u->__count);
 52         return u;
 53 }
 54 extern void free_uid(struct user_struct *);
 55 
 56 #endif /* _LINUX_SCHED_USER_H */
 57 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php