Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ad_lba(): Read bytes from disk, starting at given LBA*@state: disk parsed partitions*@lba: the Logical Block Address of the partition table*@buffer: destination buffer*@count: bytes to read* Description: Reads @count bytes from @state->bdev into @buffer.

Proto:static size_t read_lba(struct parsed_partitions *state, u64 lba, u8 *buffer, size_t count)

Type:size_t

Parameter:

TypeParameterName
struct parsed_partitions *state
u64lba
u8 *buffer
size_tcount
240  totalreadcount = 0
241  bdev = bdev
242  n = lba * bdev_logical_block_size(bdev) / 512
244  If Not buffer || lba > last_lba(): return number of last logical block of device*@bdev: block device* Description: Returns last LBA value on success, 0 on error.* This is stored (by sd and ide-geometry) in* the part[0] entry for this disk, and is the number of Then Return 0
247  When count cycle
248  copied = 512
250  data = read_part_sector(state, n++, & sect)
251  If Not data Then Break
253  If copied > count Then copied = count
255  memcpy(buffer, data, copied)
256  put_dev_sector(sect)
257  buffer += copied
258  totalreadcount += copied
259  count -= copied
261  Return totalreadcount
Caller
NameDescribe
alloc_read_gpt_entriesalloc_read_gpt_entries(): reads partition entries from disk*@state: disk parsed partitions*@gpt: GPT header* Description: Returns ptes on success, NULL on error
alloc_read_gpt_headeralloc_read_gpt_header(): Allocates GPT header, reads into it from disk*@state: disk parsed partitions*@lba: the Logical Block Address of the partition table* Description: returns GPT header on success, NULL on error. Allocates
find_valid_gptd_valid_gpt() - Search disk for valid GPT headers and PTEs*@state: disk parsed partitions*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.* Description: Returns 1 if valid, 0 on error.
alloc_pvdalloc_pvd(): reads physical volume descriptor*@state*@lba* Description: Returns pvd on success, NULL on error.* Allocates space for pvd and fill it with disk blocks at @lba* Notes: remember to free pvd when you're done!
alloc_lvnalloc_lvn(): reads logical volume names*@state*@lba* Description: Returns lvn on success, NULL on error.* Allocates space for lvn and fill it with disk blocks at @lba* Notes: remember to free lvn when you're done!