Function report |
Source Code:block\genhd.c |
Create Date:2022-07-28 17:18:03 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__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
Proto:static void __device_add_disk(struct device *parent, struct gendisk *disk, const struct attribute_group **groups, bool register_queue)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct device * | parent | |
struct gendisk * | disk | |
const struct attribute_group ** | groups | |
bool | register_queue |
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 | If retval Then |
719 | WARN_ON(1) |
720 | Return |
722 | major number of driver = MAJOR(devt) |
723 | first_minor = MINOR(devt) |
725 | disk_alloc_events(disk) |
727 | If flags & GENHD_FL_HIDDEN Then |
733 | flags |= GENHD_FL_NO_PART_SCAN |
734 | Else |
739 | ret = bdi_register_owner(backing_dev_info, disk_to_dev(disk)) |
745 | register_disk(parent, disk, groups) |
746 | If register_queue Then lk_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) |
Name | Describe |
---|---|
device_add_disk | |
device_add_disk_no_queue_reg |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |