Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:lk_alloc_queue_node - allocate a request queue*@gfp_mask: memory allocation flags*@node_id: NUMA node to allocate memory from

Proto:struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)

Type:struct request_queue

Parameter:

TypeParameterName
gfp_tgfp_mask
intnode_id
484  q = kmem_cache_alloc_node(For queue allocation, gfp_mask | __GFP_ZERO, node_id)
486  If Not q Then Return NULL
489  last_merge = NULL
491  * ida allocated id for this queue. Used to index queues from * ioctx. = ida_simple_get( & blk_queue_ida, 0, 0, gfp_mask)
492  If * ida allocated id for this queue. Used to index queues from * ioctx. < 0 Then Go to fail_q
495  ret = set_init - Initialize a bio_set*@bs: pool to initialize*@pool_size: Number of bio and bio_vecs to cache in the mempool*@front_pad: Number of bytes to allocate in front of the returned bio*@flags: Flags to modify behavior, currently %BIOSET_NEED_BVECS* and
496  If ret Then Go to fail_id
499  backing_dev_info = bdi_alloc_node(gfp_mask, node_id)
500  If Not backing_dev_info Then Go to fail_split
503  stats = blk_alloc_queue_stats()
504  If Not stats Then Go to fail_stats
507  max readahead in PAGE_SIZE units = adahead.c
508  Device capabilities = BDI_CAP_CGROUP_WRITEBACK
509  name = "block"
510  node = node_id
512  imer_setup - prepare a timer for first use*@timer: the timer in question*@callback: the function to call when timer expires*@flags: any TIMER_* flags* Regular timer initialization should use either DEFINE_TIMER() above,* or timer_setup()( & laptop_mode_wb_timer, laptop_mode_timer_fn, 0)
514  imer_setup - prepare a timer for first use*@timer: the timer in question*@callback: the function to call when timer expires*@flags: any TIMER_* flags* Regular timer initialization should use either DEFINE_TIMER() above,* or timer_setup()( & timeout, blk_rq_timed_out_timer, 0)
515  INIT_WORK( & timeout_work, blk_timeout_work)
516  Initialization list head
518  Initialization list head
521  kobject_init() - Initialize a kobject structure
526  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & sysfs_lock)
527  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & sysfs_dir_lock)
528  Process spin lock initialization( & queue_lock)
530  init_waitqueue_head( & mq_freeze_wq)
531  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & * Protect concurrent access to q_usage_counter by * percpu_ref_kill() and percpu_ref_reinit().)
537  If percpu_ref_init - initialize a percpu refcount*@ref: percpu_ref to initialize*@release: function which will be called when refcount hits 0*@flags: PERCPU_REF_INIT_* flags*@gfp: allocation mask to use* Initializes @ref Then Go to fail_bdi
542  If blkcg_init_queue(q) Then Go to fail_ref
545  Return q
547  fail_ref :
548  percpu_ref_exit - undo percpu_ref_init()*@ref: percpu_ref to exit* This function exits @ref
549  fail_bdi :
550  blk_free_queue_stats(stats)
551  fail_stats :
552  bdi_put(backing_dev_info)
553  fail_split :
554  set_exit - exit a bioset initialized with bioset_init()* May be called on a zeroed but uninitialized bioset (i.e. allocated with* kzalloc()).
555  fail_id :
556  ida_simple_remove( & blk_queue_ida, * ida allocated id for this queue. Used to index queues from * ioctx.)
557  fail_q :
558  kmem_cache_free(For queue allocation, q)
559  Return NULL
Caller
NameDescribe
blk_alloc_queue
blk_mq_init_queue