Home
last modified time | relevance | path

Searched refs:ucounts (Results 1 – 25 of 25) sorted by relevance

/linux/kernel/
H A Ducount.c11 struct ucounts init_ucounts = {
132 static struct ucounts *find_ucounts(struct user_namespace *ns, kuid_t uid, in find_ucounts()
135 struct ucounts *ucounts; in find_ucounts() local
139 hlist_nulls_for_each_entry_rcu(ucounts, pos, hashent, node) { in find_ucounts()
140 if (uid_eq(ucounts->uid, uid) && (ucounts->ns == ns)) { in find_ucounts()
141 if (rcuref_get(&ucounts->count)) in find_ucounts()
142 return ucounts; in find_ucounts()
148 static void hlist_add_ucounts(struct ucounts *ucounts) in hlist_add_ucounts() argument
150 struct hlist_nulls_head *hashent = ucounts_hashentry(ucounts->ns, ucounts->uid); in hlist_add_ucounts()
153 hlist_nulls_add_head_rcu(&ucounts->node, hashent); in hlist_add_ucounts()
[all …]
H A Dutsname.c21 static struct ucounts *inc_uts_namespaces(struct user_namespace *ns) in inc_uts_namespaces()
26 static void dec_uts_namespaces(struct ucounts *ucounts) in dec_uts_namespaces() argument
28 dec_ucount(ucounts, UCOUNT_UTS_NAMESPACES); in dec_uts_namespaces()
40 struct ucounts *ucounts; in clone_uts_ns() local
44 ucounts = inc_uts_namespaces(user_ns); in clone_uts_ns()
45 if (!ucounts) in clone_uts_ns()
57 ns->ucounts = ucounts; in clone_uts_ns()
68 dec_uts_namespaces(ucounts); in clone_uts_ns()
99 dec_uts_namespaces(ns->ucounts); in free_uts_ns()
H A Duser_namespace.c34 static struct ucounts *inc_user_namespaces(struct user_namespace *ns, kuid_t uid) in inc_user_namespaces()
39 static void dec_user_namespaces(struct ucounts *ucounts) in dec_user_namespaces() argument
41 return dec_ucount(ucounts, UCOUNT_USER_NAMESPACES); in dec_user_namespaces()
88 struct ucounts *ucounts; in create_user_ns() local
95 ucounts = inc_user_namespaces(parent_ns, owner); in create_user_ns()
96 if (!ucounts) in create_user_ns()
146 ns->ucounts = ucounts; in create_user_ns()
172 dec_user_namespaces(ucounts); in create_user_ns()
203 struct ucounts *ucounts = ns->ucounts; in free_user_ns() local
226 dec_user_namespaces(ucounts); in free_user_ns()
H A Dsys.c538 if (new->ucounts == current_ucounts()) in flag_nproc_exceeded()
548 if (is_rlimit_overlimit(new->ucounts, UCOUNT_RLIMIT_NPROC, rlimit(RLIMIT_NPROC)) && in flag_nproc_exceeded()
/linux/include/linux/
H A Duser_namespace.h42 struct ucounts;
110 struct ucounts *ucounts; member
119 struct ucounts { struct
130 extern struct ucounts init_ucounts; argument
134 struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid, enum ucount_type type);
135 void dec_ucount(struct ucounts *ucounts, enum ucount_type type);
136 struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid);
137 void put_ucounts(struct ucounts *ucounts);
139 static inline struct ucounts * __must_check get_ucounts(struct ucounts *ucounts) in get_ucounts() argument
141 if (rcuref_get(&ucounts->count)) in get_ucounts()
[all …]
H A Dsignal_types.h16 struct ucounts;
26 struct ucounts *ucounts; member
H A Dcgroup_namespace.h10 struct ucounts *ucounts; member
H A Duts_namespace.h14 struct ucounts *ucounts; member
H A Dipc_namespace.h76 struct ucounts *ucounts; member
H A Dfsnotify_backend.h262 struct ucounts *ucounts; member
274 struct ucounts *ucounts; member
H A Dmm.h3065 extern int user_shm_lock(size_t, struct ucounts *);
3066 extern void user_shm_unlock(size_t, struct ucounts *);
/linux/fs/notify/inotify/
H A Dinotify.h55 static inline void dec_inotify_instances(struct ucounts *ucounts) in dec_inotify_instances() argument
57 dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES); in dec_inotify_instances()
60 static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts) in inc_inotify_watches() argument
62 return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES); in inc_inotify_watches()
65 static inline void dec_inotify_watches(struct ucounts *ucounts) in dec_inotify_watches() argument
67 dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES); in dec_inotify_watches()
H A Dinotify_fsnotify.c183 if (group->inotify_data.ucounts) in inotify_free_group_priv()
184 dec_inotify_instances(group->inotify_data.ucounts); in inotify_free_group_priv()
/linux/kernel/cgroup/
H A Dnamespace.c12 static struct ucounts *inc_cgroup_namespaces(struct user_namespace *ns) in inc_cgroup_namespaces()
17 static void dec_cgroup_namespaces(struct ucounts *ucounts) in dec_cgroup_namespaces() argument
19 dec_ucount(ucounts, UCOUNT_CGROUP_NAMESPACES); in dec_cgroup_namespaces()
40 dec_cgroup_namespaces(ns->ucounts); in free_cgroup_ns()
53 struct ucounts *ucounts; in copy_cgroup_ns() local
67 ucounts = inc_cgroup_namespaces(user_ns); in copy_cgroup_ns()
68 if (!ucounts) in copy_cgroup_ns()
80 dec_cgroup_namespaces(ucounts); in copy_cgroup_ns()
85 new_ns->ucounts = ucounts; in copy_cgroup_ns()
/linux/ipc/
H A Dnamespace.c29 static struct ucounts *inc_ipc_namespaces(struct user_namespace *ns) in inc_ipc_namespaces()
34 static void dec_ipc_namespaces(struct ucounts *ucounts) in dec_ipc_namespaces() argument
36 dec_ucount(ucounts, UCOUNT_IPC_NAMESPACES); in dec_ipc_namespaces()
43 struct ucounts *ucounts; in create_ipc_ns() local
48 ucounts = inc_ipc_namespaces(user_ns); in create_ipc_ns()
49 if (!ucounts) { in create_ipc_ns()
71 ns->ucounts = ucounts; in create_ipc_ns()
106 dec_ipc_namespaces(ucounts); in create_ipc_ns()
164 dec_ipc_namespaces(ns->ucounts); in free_ipc_ns()
H A Dmqueue.c147 struct ucounts *ucounts; /* user who created, for accounting */ member
321 info->ucounts = NULL; /* set when all is ok */ in mqueue_get_inode()
371 info->ucounts = get_ucounts(current_ucounts()); in mqueue_get_inode()
372 if (info->ucounts) { in mqueue_get_inode()
376 msgqueue = inc_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_get_inode()
378 dec_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_get_inode()
380 put_ucounts(info->ucounts); in mqueue_get_inode()
381 info->ucounts = NULL; in mqueue_get_inode()
537 if (info->ucounts) { in mqueue_evict_inode()
549 dec_rlimit_ucounts(info->ucounts, UCOUNT_RLIMIT_MSGQUEUE, mq_bytes); in mqueue_evict_inode()
[all …]
H A Dshm.c65 struct ucounts *mlock_ucounts;
1211 struct ucounts *ucounts = current_ucounts(); in shmctl_do_lock() local
1213 err = shmem_lock(shm_file, 1, ucounts); in shmctl_do_lock()
1216 shp->mlock_ucounts = ucounts; in shmctl_do_lock()
/linux/fs/xfs/scrub/
H A Dquotacheck.c235 if (!xqc->ucounts) in xqcheck_mod_live_ino_dqtrx()
330 counts = xqc->ucounts; in xqcheck_apply_live_dqtrx()
440 if (xqc->ucounts) { in xqcheck_collect_inode()
442 error = xqcheck_update_incore_counts(xqc, xqc->ucounts, id, 1, in xqcheck_collect_inode()
724 if (xqc->ucounts) { in xqcheck_teardown_scan()
725 xfarray_destroy(xqc->ucounts); in xqcheck_teardown_scan()
726 xqc->ucounts = NULL; in xqcheck_teardown_scan()
759 sizeof(struct xqcheck_dquot), &xqc->ucounts); in xqcheck_setup_scan()
839 if (xqc->ucounts) { in xchk_quotacheck()
H A Dquotacheck.h41 struct xfarray *ucounts; member
65 return xqc->ucounts; in xqcheck_counters_for()
/linux/net/core/
H A Dnet_namespace.c468 static struct ucounts *inc_net_namespaces(struct user_namespace *ns) in inc_net_namespaces()
473 static void dec_net_namespaces(struct ucounts *ucounts) in dec_net_namespaces() argument
475 dec_ucount(ucounts, UCOUNT_NET_NAMESPACES); in dec_net_namespaces()
552 struct ucounts *ucounts; in copy_net_ns() local
559 ucounts = inc_net_namespaces(user_ns); in copy_net_ns()
560 if (!ucounts) in copy_net_ns()
572 net->ucounts = ucounts; in copy_net_ns()
592 dec_net_namespaces(ucounts); in copy_net_ns()
717 dec_net_namespaces(net->ucounts); in cleanup_net()
/linux/include/net/
H A Dnet_namespace.h94 struct ucounts *ucounts; member
/linux/security/keys/
H A Dprocess_keys.c922 if (unlikely(!get_ucounts(old->ucounts))) { in key_change_session_keyring()
937 new->ucounts = old->ucounts; in key_change_session_keyring()
/linux/fs/notify/fanotify/
H A Dfanotify.c1020 if (group->fanotify_data.ucounts) in fanotify_free_group_priv()
1021 dec_ucount(group->fanotify_data.ucounts, in fanotify_free_group_priv()
1105 dec_ucount(group->fanotify_data.ucounts, UCOUNT_FANOTIFY_MARKS); in fanotify_freeing_mark()
/linux/fs/hugetlbfs/
H A Dinode.c1516 struct ucounts *ucounts = current_ucounts(); in hugetlb_file_setup() local
1518 if (user_shm_lock(size, ucounts)) { in hugetlb_file_setup()
1521 user_shm_unlock(size, ucounts); in hugetlb_file_setup()
/linux/fs/
H A Dnamespace.c4170 static struct ucounts *inc_mnt_namespaces(struct user_namespace *ns) in inc_mnt_namespaces()
4175 static void dec_mnt_namespaces(struct ucounts *ucounts) in dec_mnt_namespaces() argument
4177 dec_ucount(ucounts, UCOUNT_MNT_NAMESPACES); in dec_mnt_namespaces()
4184 dec_mnt_namespaces(ns->ucounts); in free_mnt_ns()
4191 struct ucounts *ucounts; in alloc_mnt_ns() local
4194 ucounts = inc_mnt_namespaces(user_ns); in alloc_mnt_ns()
4195 if (!ucounts) in alloc_mnt_ns()
4200 dec_mnt_namespaces(ucounts); in alloc_mnt_ns()
4210 dec_mnt_namespaces(ucounts); in alloc_mnt_ns()
4220 new_ns->ucounts = ucounts; in alloc_mnt_ns()