函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bsg_register_queue

函数原型:int bsg_register_queue(struct request_queue *q, struct device *parent, const char *name, const struct bsg_ops *ops)

返回类型:int

参数:

类型参数名称
struct request_queue *q
struct device *parent
const char *name
const struct bsg_ops *ops
412  struct device * class_dev = NULL
417  如果非queue_is_mq(q)则返回:0
420  bcd等于bsg_dev
421  memset(bcd, 0, bcd的长度)
423  mutex_lock( & bsg_mutex)
425  ret等于dr_alloc() - Allocate an ID.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@start: The minimum ID (inclusive).*@end: The maximum ID (exclusive).*@gfp: Memory allocation flags.
426  如果ret小于0则
427  如果ret恒等于负ENOSPC
429  ret等于负EINVAL
431  转到:unlock
434  minor等于ret
435  queue等于q
436  ops等于ops
437  dev等于MKDEV(bsg_major, minor)
438  class_dev等于device_create(bsg_class, parent, dev, NULL, "%s", name)
439  如果是错误
440  ret等于错误
441  转到:idr_remove
443  class_dev等于class_dev
445  如果 sysfs directory entry
446  ret等于sysfs_create_link( & * queue kobject, & kobj, "bsg")
447  如果ret则转到:unregister_class_dev
451  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.
452  返回:0
454  unregister_class_dev :
455  device_unregister(class_dev)
456  idr_remove :
457  删除释放idr
458  unlock :
459  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.
460  返回:ret
调用者
名称描述
bsg_scsi_register_queue
bsg_setup_queuesg_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