Contributors: 20
Author Tokens Token Proportion Commits Commit Proportion
Ingo Molnar 94 51.37% 10 32.26%
Alexei Starovoitov 10 5.46% 1 3.23%
Chris Wright 9 4.92% 1 3.23%
David Howells 9 4.92% 1 3.23%
Tony Luck 8 4.37% 1 3.23%
Peter Zijlstra 7 3.83% 2 6.45%
Willem de Bruijn 6 3.28% 1 3.23%
Matthew Rosato 6 3.28% 1 3.23%
Jens Axboe 5 2.73% 1 3.23%
Sebastian Andrzej Siewior 5 2.73% 1 3.23%
Jason Gunthorpe 5 2.73% 1 3.23%
Nicholas Piggin 5 2.73% 1 3.23%
Willy Tarreau 3 1.64% 2 6.45%
Frédéric Weisbecker 3 1.64% 1 3.23%
Michal Hocko 2 1.09% 1 3.23%
Linus Torvalds (pre-git) 2 1.09% 1 3.23%
KaiGai Kohei 1 0.55% 1 3.23%
David S. Miller 1 0.55% 1 3.23%
Greg Kroah-Hartman 1 0.55% 1 3.23%
Roland McGrath 1 0.55% 1 3.23%
Total 183 31


/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_SCHED_USER_H
#define _LINUX_SCHED_USER_H

#include <linux/uidgid.h>
#include <linux/atomic.h>
#include <linux/percpu_counter.h>
#include <linux/refcount.h>
#include <linux/ratelimit.h>

/*
 * Some day this will be a full-fledged user tracking system..
 */
struct user_struct {
	refcount_t __count;	/* reference count */
#ifdef CONFIG_EPOLL
	struct percpu_counter epoll_watches; /* The number of file descriptors currently watched */
#endif
	unsigned long unix_inflight;	/* How many files in flight in unix sockets */
	atomic_long_t pipe_bufs;  /* how many pages are allocated in pipe buffers */

	/* Hash table maintenance information */
	struct hlist_node uidhash_node;
	kuid_t uid;

#if defined(CONFIG_PERF_EVENTS) || defined(CONFIG_BPF_SYSCALL) || \
	defined(CONFIG_NET) || defined(CONFIG_IO_URING) || \
	defined(CONFIG_VFIO_PCI_ZDEV_KVM) || IS_ENABLED(CONFIG_IOMMUFD)
	atomic_long_t locked_vm;
#endif
#ifdef CONFIG_WATCH_QUEUE
	atomic_t nr_watches;	/* The number of watches this user currently has */
#endif

	/* Miscellaneous per-user rate limit */
	struct ratelimit_state ratelimit;
};

extern int uids_sysfs_init(void);

extern struct user_struct *find_user(kuid_t);

extern struct user_struct root_user;
#define INIT_USER (&root_user)


/* per-UID process charging. */
extern struct user_struct * alloc_uid(kuid_t);
static inline struct user_struct *get_uid(struct user_struct *u)
{
	refcount_inc(&u->__count);
	return u;
}
extern void free_uid(struct user_struct *);

#endif /* _LINUX_SCHED_USER_H */