函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sg_setup_queue - Create and add the bsg hooks so we can receive requests*@dev: device to attach bsg device to*@name: device to give bsg device*@job_fn: bsg job handler*@timeout: timeout handler function pointer*@dd_job_size: size of LLD data needed for

函数原型:struct request_queue *bsg_setup_queue(struct device *dev, const char *name, bsg_job_fn *job_fn, bsg_timeout_fn *timeout, int dd_job_size)

返回类型:struct request_queue

参数:

类型参数名称
struct device *dev
const char *name
bsg_job_fn *job_fn
bsg_timeout_fn *timeout
intdd_job_size
368  ret等于负ENOMEM
370  bset等于分配内存并置零
371  如果非bset则返回:错误号
374  job_fn等于job_fn
375  timeout_fn等于timeout
377  set等于tag_set
378  ops等于bsg_mq_ops, nr_hw_queues等于1
380  queue_depth等于128
381  numa_node等于NUMA_NO_NODE
382  cmd_size等于sizeof(structbsg_job)加dd_job_size
383  flags等于BLK_MQ_F_NO_SCHED按位或BLK_MQ_F_BLOCKING
384  如果Alloc a tag set to be associated with one or more request queues.* May fail with EINVAL for various error conditions. May adjust the* requested depth down, if it's too large. In that case, the set* value will be stored in set->queue_depth.则转到:out_tag_set
387  q等于blk_mq_init_queue(set)
388  如果是错误
389  ret等于错误
390  转到:out_queue
393  * The queue owner gets to use this for whatever they like. * ll_rw_blk doesn't touch it.等于dev
394  blk_queue_rq_timeout(q, default timeout for SG_IO if none specified)
396  ret等于bsg_register_queue(q, dev, name, & bsg_transport_ops)
397  如果ret
398  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
400  转到:out_cleanup_queue
403  返回:q
404  out_cleanup_queue :
405  释放请求队列
406  out_queue :
407  blk_mq_free_tag_set(set)
408  out_tag_set :
409  释放内存
410  返回:错误号