函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_gendisk - get partitioning information for a given device*@devt: device to get partitioning information for*@partno: returned partition index* This function gets the structure containing partitioning* information for the given device @devt.

函数原型:struct gendisk *get_gendisk(dev_t devt, int *partno)

返回类型:struct gendisk

参数:

类型参数名称
dev_tdevt
int *partno
873  struct gendisk * disk = NULL
875  如果MAJOR(devt)不等于BLOCK_EXT_MAJOR
878  kobj等于kobj_lookup(bdev_map, devt, partno)
879  如果kobjdisk等于dev_to_disk(kobj_to_dev(kobj))
881  否则
884  spin_lock_bh( & For extended devt allocation. ext_devt_lock prevents look up* results from going away underneath its user.)
885  part等于dr_find() - Return pointer for given ID
887  partno等于partno
888  disk等于part_to_disk(part)
890  spin_unlock_bh( & For extended devt allocation. ext_devt_lock prevents look up* results from going away underneath its user.)
893  如果非disk则返回:NULL
900  lock for reading
901  如果此条件成立可能性小(为编译器优化)((flags & GENHD_FL_HIDDEN) || !(flags & GENHD_FL_UP))则
903  lease a read lock
904  This is a counterpart of get_disk_and_module() and thus also of* get_gendisk().
905  disk = NULL
906  否则
907  lease a read lock
909  返回:disk
调用者
名称描述
blkcg_conf_get_disklkg_conf_prep - parse and prepare for per-blkg config update*@inputp: input string pointer* Parse the device node prefix part, MAJ:MIN, of per-blkg config update* from @input and get and return the matching gendisk. *@inputp is
software_resumesoftware_resume - Resume from a saved hibernation image.* This routine is called as a late initcall, when all devices have been* discovered and initialized already.* The image reading code is called to see if there is a hibernation image