函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int blk_alloc_devt(struct hd_struct *part, dev_t *devt)

返回类型:int

参数:

类型参数名称
struct hd_struct *part
dev_t *devt
490  disk等于part_to_disk(part)
494  如果partno小于 maximum number of minors, =1 for * disks that can't be partitioned.
495  devt等于MKDEV( major number of driver , first_minor + partno)
496  返回:0
500  dr_preload - preload for idr_alloc()*@gfp_mask: allocation mask to use for preloading* Preallocate memory to use for the next call to idr_alloc(). This function* returns with preemption disabled. It will be enabled by idr_preload_end().
502  spin_lock_bh( & For extended devt allocation. ext_devt_lock prevents look up* results from going away underneath its user.)
503  idx等于dr_alloc() - Allocate an ID.*@idr: IDR handle.*@ptr: Pointer to be associated with the new ID.*@start: The minimum ID (inclusive).*@end: The maximum ID (exclusive).*@gfp: Memory allocation flags.
504  spin_unlock_bh( & For extended devt allocation. ext_devt_lock prevents look up* results from going away underneath its user.)
506  dr_preload_end - end preload section started with idr_preload()* Each idr_preload() should be matched with an invocation of this* function. See idr_preload() for details.
507  如果idx小于0则返回:如果idx恒等于负ENOSPC则负EBUSY否则idx
510  devt等于MKDEV(BLOCK_EXT_MAJOR, lk_mangle_minor - scatter minor numbers apart*@minor: minor number to mangle* Scatter consecutively allocated @minor number apart if MANGLE_DEVT* is enabled. Mangling twice gives the original value.* RETURNS:* Mangled value.* CONTEXT:* Don't care.)
511  返回:0
调用者
名称描述
__device_add_disk__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
add_partitionMust be called either with bd_mutex held, before a disk can be opened or* after all disk users are gone.