Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:blkcg_css_alloc

Proto:static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup_subsys_state *parent_css)

Type:struct cgroup_subsys_state

Parameter:

TypeParameterName
struct cgroup_subsys_state *parent_css
948  mutex_lock( & blkcg_pol_mutex)
950  If Not parent_css Then
951  blkcg = blkcg_root
952  Else
953  blkcg = 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).
954  If Not blkcg Then
955  ret = ERR_PTR( - ENOMEM)
956  Go to unlock
960  When i < Maximum number of blkcg policies allowed to be registered concurrently.* Defined here to simplify include dependency. cycle
961  pol = blkcg_policy[i]
970  If Not pol || Not operations Then Continue
973  cpd = operations (GFP_KERNEL)
974  If Not cpd Then
975  ret = ERR_PTR( - ENOMEM)
976  Go to free_pd_blkcg
978  cpd[i] = cpd
979  the blkcg and policy id this per-policy data belongs to = blkcg
980  plid = i
981  If cpd_init_fn Then cpd_init_fn(cpd)
985  Process spin lock initialization( & lock)
986  INIT_RADIX_TREE( & blkg_tree, GFP_NOWAIT | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.)
987  INIT_HLIST_HEAD( & blkg_list)
992  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
994  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
995  Return css
997  free_pd_blkcg :
998  When i >= 0 cycle If cpd[i] Then
1000  cpd_free_fn(cpd[i])
1002  If blkcg != blkcg_root Then kfree(blkcg)
1004  unlock :
1005  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1006  Return ret