Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sun_partition

Proto:int sun_partition(struct parsed_partitions *state)

Type:int

Parameter:

TypeParameterName
struct parsed_partitions *state
18  slot = 1
21  struct sun_disklabel{unsigned char info[128];struct sun_vtoc{__be32 version;char volume[8];__be16 nparts;struct sun_info{__be16 id;__be16 flags;}infos[8];__be16 padding;__be32 bootinfo[3];__be32 sanity;__be32 reserved[10];__be32 timestamp[8];}vtoc;__be32 write_reinstruct;__be32 read_reinstruct;unsigned char spare[148];__be16 rspeed;__be16 pcylcount;__be16 sparecyl;__be16 obs1;__be16 obs2;__be16 ilfact;__be16 ncyl;__be16 nacyl;__be16 ntrks;__be16 nsect;__be16 obs3;__be16 obs4;struct sun_partition{__be32 start_cylinder;__be32 num_sectors;}partitions[8];__be16 magic;__be16 csum;} * label
65  label = read_part_sector(state, 0, & sect)
66  If Not label Then Return -1
69  p = partitions
70  If be16_to_cpu(magic) != s/partitions/sun.h Then
73  put_dev_sector(sect)
74  Return 0
77  ush = label + 1 - 1
78  When ush >= label cycle csum ^= ush--
80  If csum Then
81  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
83  put_dev_sector(sect)
84  Return 0
88  use_vtoc = be32_to_cpu(sanity) == SUN_VTOC_SANITY && be32_to_cpu(version) == 1 && be16_to_cpu(nparts) <= 8
93  nparts = If use_vtoc Then be16_to_cpu(nparts) Else 8
99  use_vtoc = use_vtoc || Not ( sanity || version || nparts)
101  spc = be16_to_cpu(ntrks) * be16_to_cpu(nsect)
102  When i < nparts cycle
106  st_sector = be32_to_cpu(start_cylinder) * spc
107  num_sectors = be32_to_cpu(num_sectors)
108  If num_sectors Then
110  flags = 0
111  If use_vtoc Then
118  slot++
120  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.
121  put_dev_sector(sect)
122  Return 1