Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\ucount.c Create Date:2022-07-28 09:34:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_ucounts

Proto:static struct ucounts *get_ucounts(struct user_namespace *ns, kuid_t uid)

Type:struct ucounts

Parameter:

TypeParameterName
struct user_namespace *ns
kuid_tuid
127  hashent = ucounts_hashentry(ns, uid)
130  spin_lock_irq( & ucounts_lock)
131  ucounts = find_ucounts(ns, uid, hashent)
132  If Not ucounts Then
133  spin_unlock_irq( & ucounts_lock)
135  new = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
136  If Not new Then Return NULL
139  ns = ns
140  uid = uid
141  count = 0
143  spin_lock_irq( & ucounts_lock)
144  ucounts = find_ucounts(ns, uid, hashent)
145  If ucounts Then
147  Else
149  ucounts = new
152  If count == INT_MAX Then ucounts = NULL
154  Else count += 1
156  spin_unlock_irq( & ucounts_lock)
157  Return ucounts
Caller
NameDescribe
inc_ucount