Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:If @new_blkg is %NULL, this function tries to allocate a new one as* necessary using %GFP_NOWAIT. @new_blkg is always consumed on return.

Proto:static struct blkcg_gq *blkg_create(struct blkcg *blkcg, struct request_queue *q, struct blkcg_gq *new_blkg)

Type:struct blkcg_gq

Parameter:

TypeParameterName
struct blkcg *blkcg
struct request_queue *q
struct blkcg_gq *new_blkg
233  WARN_ON_ONCE(!_read_lock_held() - might we be in RCU read-side critical section?* If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU* read-side critical section)
234  lockdep_assert_held( & queue_lock)
237  If blk_queue_dying(q) Then
238  ret = -ENODEV
239  Go to err_free_blkg
243  If Not ss_tryget_online - try to obtain a reference on the specified css if online*@css: target css* Obtain a reference on @css if it's online Then
244  ret = -ENODEV
245  Go to err_free_blkg
248  wb_congested = wb_congested_get_create(backing_dev_info, PI: Subsys-unique ID. 0 is unused and root is always 1. The* matching css can be looked up using css_from_id()., 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.)
251  If Not wb_congested Then
252  ret = -ENOMEM
253  Go to err_put_css
257  If Not new_blkg Then
258  new_blkg = lkg_alloc - allocate a blkg*@blkcg: block cgroup the new blkg is associated with*@q: request_queue the new blkg is associated with*@gfp_mask: allocation mask to use* Allocate a new blkg assocating @blkcg and @q.
260  ret = -ENOMEM
261  Go to err_put_congested
264  blkg = new_blkg
265  * Each blkg gets congested separately and the congestion state is * propagated to the matching bdi_writeback_congested. = wb_congested
268  If lkcg_parent - get the parent of a blkcg*@blkcg: blkcg of interest* Return the parent blkcg of @blkcg. Can be called anytime. Then
269  all non-root blkcg_gq's are guaranteed to have access to parent = __blkg_lookup - internal version of blkg_lookup()*@blkcg: blkcg of interest*@q: request_queue of interest*@update_hint: whether to update lookup hint with the result or not* This is internal version and shouldn't be used by policy* implementations
271  ret = -ENODEV
272  Go to err_put_congested
274  lkg_get - get a blkg reference*@blkg: blkg to get* The caller should be holding an existing reference.
278  When i < Maximum number of blkcg policies allowed to be registered concurrently.* Defined here to simplify include dependency. cycle
279  pol = blkcg_policy[i]
281  If pd[i] && pd_init_fn Then pd_init_fn(pd[i])
286  spin_lock( & lock)
287  ret = __radix_tree_insert - insert into a radix tree*@root: radix tree root*@index: index key*@item: item to insert* Insert an item into the radix tree at position @index.
288  If Value is more likely to compile time(!ret) Then
289  adds the specified element to the specified hlist
290  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
293  pol = blkcg_policy[i]
295  If pd[i] && pd_online_fn Then pd_online_fn(pd[i])
299  is this blkg online? protected by both blkcg and q locks = true
300  spin_unlock( & lock)
302  If Not ret Then Return blkg
306  lkg_put - put a blkg reference*@blkg: blkg to put
307  Return ERR_PTR(ret)
309  err_put_congested :
310  wb_congested_put(wb_congested)
311  err_put_css :
312  ss_put - put a css reference*@css: target css* Put a reference obtained via css_get() and css_tryget_online().
313  err_free_blkg :
314  lkg_free - free a blkg*@blkg: blkg to free* Free @blkg which may be partially allocated.
315  Return ERR_PTR(ret)
Caller
NameDescribe
__blkg_lookup_create__blkg_lookup_create - lookup blkg, try to create one if not there*@blkcg: blkcg of interest*@q: request_queue of interest* Lookup blkg for the @blkcg - @q pair. If it doesn't exist, try to* create one
blkg_conf_preplkg_conf_prep - parse and prepare for per-blkg config update*@blkcg: target block cgroup*@pol: target policy*@input: input string*@ctx: blkg_conf_ctx to be filled* Parse per-blkg config update from @input and initialize @ctx with the* result
blkcg_init_queuelkcg_init_queue - initialize blkcg part of request queue*@q: request_queue to initialize* Called from blk_alloc_queue_node(). Responsible for initializing blkcg* part of new request_queue @q.* RETURNS:* 0 on success, -errno on failure.