Skip to content
Snippets Groups Projects
Select Git revision
  • 64af4e0da419ef9e9db0d34a3b5836adbf90a5e8
  • openEuler-1.0-LTS default protected
  • openEuler-22.09
  • OLK-5.10
  • openEuler-22.03-LTS
  • openEuler-22.03-LTS-Ascend
  • master
  • openEuler-22.03-LTS-LoongArch-NW
  • openEuler-22.09-HCK
  • openEuler-20.03-LTS-SP3
  • openEuler-21.09
  • openEuler-21.03
  • openEuler-20.09
  • 4.19.90-2210.5.0
  • 5.10.0-123.0.0
  • 5.10.0-60.63.0
  • 5.10.0-60.62.0
  • 4.19.90-2210.4.0
  • 5.10.0-121.0.0
  • 5.10.0-60.61.0
  • 4.19.90-2210.3.0
  • 5.10.0-60.60.0
  • 5.10.0-120.0.0
  • 5.10.0-60.59.0
  • 5.10.0-119.0.0
  • 4.19.90-2210.2.0
  • 4.19.90-2210.1.0
  • 5.10.0-118.0.0
  • 5.10.0-106.19.0
  • 5.10.0-60.58.0
  • 4.19.90-2209.6.0
  • 5.10.0-106.18.0
  • 5.10.0-106.17.0
33 results

find_bit.c

Blame
  • user.h 1.81 KiB
    /* 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/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 */
    	atomic_t processes;	/* How many processes does this user have? */
    	atomic_t sigpending;	/* How many pending signals does this user have? */
    #ifdef CONFIG_FANOTIFY
    	atomic_t fanotify_listeners;
    #endif
    #ifdef CONFIG_EPOLL
    	atomic_long_t epoll_watches; /* The number of file descriptors currently watched */
    #endif
    #ifdef CONFIG_POSIX_MQUEUE
    	/* protected by mq_lock	*/
    	unsigned long mq_bytes;	/* How many bytes can be allocated to mqueue? */
    #endif
    	unsigned long locked_shm; /* How many pages of mlocked shm ? */
    	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)
    	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 */