函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:disk_part_iter_next - proceed iterator to the next partition and return it*@piter: iterator of interest* Proceed @piter to the next partition and return it.* CONTEXT:* Don't care.

函数原型:struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter)

返回类型:struct hd_struct

参数:

类型参数名称
struct disk_part_iter *piter
198  disk_put_part(part)
199  part = NULL
202  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
203  ptbl等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().( 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.)
206  如果flags按位与rate in the reverse direction
207  inc等于负1
208  如果flags按位与clude partition 0 按位或clude empty partition 0 的值则end等于负1
211  否则end等于0
213  否则
214  inc等于1
215  end等于len
219 idx不等于end循环
222  part等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(part[idx])
223  如果非part则继续下一循环
225  如果非Any access of part->nr_sects which is not protected by partition* bd_mutex or gendisk bdev bd_mutex, should be done using this* accessor function且非flags按位与clude 0-sized parts 的值且非flags按位与clude empty partition 0 idx恒等于0的值则继续下一循环
231  get_device - atomically increment the reference count for the device.
232  part等于part
233  idx加等于inc
234  退出
237  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
239  返回:part
调用者
名称描述
blkpg_ioctl
register_disk
del_gendisk
printk_all_partitionsprint a full list of all partitions - intended for places where the root* filesystem can't be mounted and thus to give the victim some idea of what* went wrong
show_partition
diskstats_showaggregate disk stat collector. Uses the same stats that the sysfs* entries do, above, but makes them available through one seq_file.* The output looks suspiciously like /proc/partitions with a bunch of* extra fields.
set_disk_ro
blk_drop_partitions