函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__alloc_disk_node

函数原型:struct gendisk *__alloc_disk_node(int minors, int node_id)

返回类型:struct gendisk

参数:

类型参数名称
intminors
intnode_id
1473  如果minors大于DISK_MAX_PARTS
1474  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
1477  minors等于DISK_MAX_PARTS
1480  disk等于根据内存节点分配内存
1481  如果disk
1482  如果非init_part_stats( & part0)则
1483  释放内存
1484  返回:NULL
1486  init_rwsem( & lookup_sem)
1487  node_id等于node_id
1489  free_part_stats( & part0)
1490  释放内存
1491  返回:NULL
1493  ptbl等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit( Array of pointers to partitions indexed by partno. * Protected with matching bdev lock but stat and other * non-critical accesses use RCU. Always access through * helpers., 1)
1494  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(part[0], & part0)
1505  seqcount_init( & nr_sects_seq)
1506  如果hd_ref_init( & part0)则
1507  hd_free_part( & part0)
1508  释放内存
1509  返回:NULL
1512  maximum number of minors, =1 for * disks that can't be partitioned. 等于minors
1513  rand_initialize_disk(disk)
1514  class等于block_class
1515  type等于disk_type
1516  device_initialize(disk_to_dev(disk))
1518  返回:disk