Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\genhd.c Create Date:2022-07-28 17:17:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:int blk_alloc_devt(struct hd_struct *part, dev_t *devt)

Type:int

Parameter:

TypeParameterName
struct hd_struct *part
dev_t *devt
490  disk = part_to_disk(part)
494  If partno < maximum number of minors, =1 for * disks that can't be partitioned. Then
495  devt = MKDEV( major number of driver , first_minor + partno)
496  Return 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  If idx < 0 Then Return If idx == -ENOSPC Then -EBUSY Else 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  Return 0
Caller
NameDescribe
__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.