函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\blk-cgroup.c Create Date:2022-07-27 19:16:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:lkcg_activate_policy - activate a blkcg policy on a request_queue*@q: request_queue of interest*@pol: blkcg policy to activate* Activate @pol on @q

函数原型:int blkcg_activate_policy(struct request_queue *q, const struct blkcg_policy *pol)

返回类型:int

参数:

类型参数名称
struct request_queue *q
const struct blkcg_policy *pol
1241  struct blkg_policy_data * pd_prealloc = NULL
1242  struct blkcg_gq * blkg, * pinned_blkg = NULL
1245  如果blkcg_policy_enabled(q, pol)则返回:0
1248  如果queue_is_mq(q)则blk_mq_freeze_queue(q)
1250  retry :
1251  spin_lock_irq( & queue_lock)
1257  如果pd[plid]则继续下一循环
1261  如果blkg恒等于pinned_blkg
1262  pd等于pd_prealloc
1263  pd_prealloc = NULL
1264  否则
1265  pd等于pd_alloc_fn(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., q, blkcg)
1269  如果非pd
1274  如果pinned_blkglkg_put - put a blkg reference*@blkg: blkg to put
1276  lkg_get - get a blkg reference*@blkg: blkg to get* The caller should be holding an existing reference.
1277  pinned_blkg等于blkg
1279  spin_unlock_irq( & queue_lock)
1281  如果pd_preallocpd_free_fn(pd_prealloc)
1283  pd_prealloc等于pd_alloc_fn(GFP_KERNEL, q, blkcg)
1285  如果pd_prealloc则转到:retry
1287  否则转到:enomem
1291  pd[plid]等于pd
1292  he blkg and policy id this per-policy data belongs to 等于blkg
1293  plid等于plid
1297  如果pd_init_fnlist_for_each_entry_reverse - iterate backwards over list of given type.*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(blkg, & blkg_list, q_node)
1299  pd_init_fn(pd[plid])
1301  __set_bit - Set a bit in memory*@nr: the bit to set*@addr: the address to start counting from* Unlike set_bit(), this function is non-atomic. If it is called on the same* region of memory concurrently, the effect may be that only one operation* succeeds.
1302  ret等于0
1304  spin_unlock_irq( & queue_lock)
1305  out :
1306  如果queue_is_mq(q)则blk_mq_unfreeze_queue(q)
1308  如果pinned_blkglkg_put - put a blkg reference*@blkg: blkg to put
1310  如果pd_preallocpd_free_fn(pd_prealloc)
1312  返回:ret
1314  enomem :
1316  spin_lock_irq( & queue_lock)
1318  如果pd[plid]则
1319  pd_free_fn(pd[plid])
1320  pd[plid] = NULL
1323  spin_unlock_irq( & queue_lock)
1324  ret等于负ENOMEM
1325  转到:out
调用者
名称描述
blk_throtl_init
blk_iolatency_init
blk_iocost_init