Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:amiga_partition

Proto:int amiga_partition(struct parsed_partitions *state)

Type:int

Parameter:

TypeParameterName
struct parsed_partitions *state
35  res = 0
36  blksize = 1
37  slot = 1
40  cycle
41  If blk == RDB_ALLOCATION_LIMIT Then Go to rdb_done
43  data = read_part_sector(state, blk, & sect)
44  If Not data Then
45  If This is ugly: should make genhd removable media aware Then pr_err("Dev %s: unable to read RDB block %d\n", bdevname(bdev, b), blk)
48  res = -1
49  Go to rdb_done
51  If data != cpu_to_be32("RDSK" ) Then Continue
54  rdb = data
55  If checksum_block((__be32 * )data, be32_to_cpu(rdb_SummedLongs) & 0x7F) == 0 Then Break
60  *(data + 0xdc) = 0
61  If checksum_block((__be32 * )data, be32_to_cpu(rdb_SummedLongs) & 0x7F) == 0 Then
63  pr_err("Trashed word at 0xd0 in block %d ignored in checksum calculation\n", blk)
65  Break
68  pr_err("Dev %s: RDB in block %d has bad checksum\n", bdevname(bdev, b), blk)
73  blksize = be32_to_cpu(rdb_BlockBytes) / 512
79  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
80  strlcat - Append a length-limited, C-string to another*@dest: The string to be appended to*@src: The string to append to it*@count: The size of the destination buffer.
82  blk = be32_to_cpu(rdb_PartitionList)
83  put_dev_sector(sect)
84  When blk > 0 && part <= 16 cycle
85  blk *= blksize
86  data = read_part_sector(state, blk, & sect)
87  If Not data Then
88  If This is ugly: should make genhd removable media aware Then pr_err("Dev %s: unable to read partition block %d\n", bdevname(bdev, b), blk)
91  res = -1
92  Go to rdb_done
94  pb = data
95  blk = be32_to_cpu(pb_Next)
96  If pb_ID != cpu_to_be32("PART" ) Then Continue
98  If checksum_block((__be32 * )pb, be32_to_cpu(pb_SummedLongs) & 0x7F) != 0 Then Continue
103  nr_sects = ( be32_to_cpu(pb_Environment[10]) + 1 - be32_to_cpu(pb_Environment[9])) * be32_to_cpu(pb_Environment[3]) * be32_to_cpu(pb_Environment[5]) * blksize
108  If Not nr_sects Then Continue
110  start_sect = be32_to_cpu(pb_Environment[9]) * be32_to_cpu(pb_Environment[3]) * be32_to_cpu(pb_Environment[5]) * blksize
120  dt = dostype
121  dt = pb_Environment[16]
136  res = 1
138  strlcat - Append a length-limited, C-string to another*@dest: The string to be appended to*@src: The string to append to it*@count: The size of the destination buffer.
140  rdb_done :
141  Return res