函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sun_partition

函数原型:int sun_partition(struct parsed_partitions *state)

返回类型:int

参数:

类型参数名称
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  如果非label则返回:负1
69  p等于partitions
70  如果be16_to_cpu(magic)不等于s/partitions/sun.h
73  put_dev_sector(sect)
74  返回:0
77  ush等于label加1减1
78 ush大于等于label循环csum异或等于ush自减
80  如果csum
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  返回:0
88  use_vtoc等于be32_to_cpu(sanity)恒等于SUN_VTOC_SANITYbe32_to_cpu(version)恒等于1且be16_to_cpu(nparts)小于等于8
93  nparts等于如果use_vtocbe16_to_cpu(nparts)否则8
99  use_vtoc等于use_vtoc或非sanityversionnparts的值
101  spc等于be16_to_cpu(ntrks)乘be16_to_cpu(nsect)
102 i小于nparts循环
106  st_sector等于be32_to_cpu(start_cylinder)乘spc
107  num_sectors等于be32_to_cpu(num_sectors)
108  如果num_sectors
110  flags等于0
111  如果use_vtoc
112  如果be16_to_cpu(id)恒等于LINUX_RAID_PARTITIONflags或等于ADDPART_FLAG_RAID
114  否则如果be16_to_cpu(id)恒等于SUN_WHOLE_DISKflags或等于ADDPART_FLAG_WHOLEDISK
118  slot自加
120  长字符串拼接
121  put_dev_sector(sect)
122  返回:1