函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__device_add_disk - add disk information to kernel list*@parent: parent device for the disk*@disk: per-device partitioning information*@groups: Additional per-device sysfs groups*@register_queue: register the queue if set to true* This function registers

函数原型:static void __device_add_disk(struct device *parent, struct gendisk *disk, const struct attribute_group **groups, bool register_queue)

返回类型:void

参数:

类型参数名称
struct device *parent
struct gendisk *disk
const struct attribute_group **groups
boolregister_queue
704  如果register_queueFor a device queue that has no required features, use the default elevator* settings. Otherwise, use the first elevator available matching the required* features. If no suitable elevator is find or if the chosen elevator
711  WARN_ON( maximum number of minors, =1 for * disks that can't be partitioned. && !( major number of driver || first_minor))
712  WARN_ON(! maximum number of minors, =1 for * disks that can't be partitioned. && !(flags & (allow extended devt | GENHD_FL_HIDDEN)))
715  flags或等于GENHD_FL_UP
717  retval等于lk_alloc_devt - allocate a dev_t for a partition*@part: partition to allocate dev_t for*@devt: out parameter for resulting dev_t* Allocate a dev_t for block device
718  如果retval
719  WARN_ON(1)
720  返回
722  major number of driver 等于MAJOR(devt)
723  first_minor等于MINOR(devt)
725  disk_alloc_events(disk)
727  如果flags按位与GENHD_FL_HIDDEN
732  flags或等于GENHD_FL_SUPPRESS_PARTITION_INFO
733  flags或等于GENHD_FL_NO_PART_SCAN
734  否则
738  dev_t, creates the sysfs "dev" 等于devt
739  ret等于bdi_register_owner(backing_dev_info, disk_to_dev(disk))
741  WARN_ON(ret)
742  Register device numbers dev..(dev+range-1)* range must be nonzero* The hash chain is sorted on range, so that subranges can override.
745  register_disk(parent, disk, groups)
746  如果register_queuelk_register_queue - register a block layer queue with sysfs*@disk: Disk of which the request queue should be registered with sysfs.
753  WARN_ON_ONCE(!blk_get_queue(queue))
755  disk_add_events(disk)
756  blk_integrity_add(disk)
调用者
名称描述
device_add_disk
device_add_disk_no_queue_reg