函数逻辑报告 |
Source Code:block\partition-generic.c |
Create Date:2022-07-27 18:56:31 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:Must be called either with bd_mutex held, before a disk can be opened or* after all disk users are gone.
函数原型:struct hd_struct *add_partition(struct gendisk *disk, int partno, sector_t start, sector_t len, int flags, struct partition_meta_info *info)
返回类型:struct hd_struct
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct gendisk * | disk | |
| int | partno | |
| sector_t | start | |
| sector_t | len | |
| int | flags | |
| struct partition_meta_info * | info |
| 318 | ddev等于disk_to_dev(disk) |
| 330 | 打印警告信息("%s: partitions not supported on host managed zoned block device\n", name of major driver ) |
| 332 | 返回:错误号 |
| 334 | 打印信息("%s: disabling host aware zoned block device support due to partitions\n", name of major driver ) |
| 337 | 退出 |
| 338 | 当:zoned恒等于Regular block device |
| 339 | 退出 |
| 354 | 如果非init_part_stats(p)则 |
| 359 | seqcount_init( & nr_sects_seq) |
| 360 | pdev等于part_to_dev(p) |
| 362 | start_sect等于start |
| 367 | * nr_sects is protected by sequence counter. One might extend a * partition while IO is happening to it and update of nr_sects * can be non-atomic on 32bit machines with 64bit sector_t.等于len |
| 369 | policy等于get_disk_ro(disk) |
| 371 | 如果info则 |
| 382 | 如果是数字则dev_set_name(pdev, "%sp%d", dname, partno) |
| 384 | 否则dev_set_name(pdev, "%s%d", dname, partno) |
| 387 | device_initialize(pdev) |
| 388 | class等于block_class |
| 392 | err等于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 |
| 393 | 如果err则转到:out_free_info |
| 398 | dev_set_uevent_suppress(pdev, 1) |
| 399 | err等于device_add(pdev) |
| 405 | 如果非holder_dir则转到:out_del |
| 408 | dev_set_uevent_suppress(pdev, 0) |
| 409 | 如果flags按位与ADDPART_FLAG_WHOLEDISK则 |
| 410 | err等于device_create_file(pdev, & dev_attr_whole_disk) |
| 415 | err等于hd_ref_init(p) |
| 416 | 如果err则 |
| 417 | 如果flags按位与ADDPART_FLAG_WHOLEDISK则转到:out_remove_file |
| 419 | 转到:out_del |
| 428 | 返回:p |
| 430 | out_free_info : |
| 431 | free_part_info(p) |
| 432 | out_free_stats : |
| 433 | free_part_stats(p) |
| 434 | out_free : |
| 435 | 释放内存 |
| 436 | 返回:错误号 |
| 437 | out_remove_file : |
| 439 | out_del : |
| 440 | 递减引用计数对象 |
| 441 | device_del(pdev) |
| 442 | out_put : |
| 443 | put_device(pdev) |
| 444 | 返回:错误号 |
| 名称 | 描述 |
|---|---|
| blk_add_partition |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |