| Function report | 
| Source Code: init\do_mounts_md.c | Create Date:2022-07-28 13:58:59 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:md_setup_drive
Proto:static void __init md_setup_drive(void)
Type:void
Parameter:Nothing
| 123 | When ent < md_setup_ents cycle | 
| 125 | err = 0 | 
| 131 | partitioned = partitioned | 
| 132 | devname = device_names | 
| 134 | sprintf(name, "/dev/md%s%d", partitioned ? "_d" : "", minor) | 
| 135 | If partitioned Then dev = MKDEV(mdp_major, minor << 63 partitions with the alternate major number (mdp) ) | 
| 139 | create_dev(name, dev) | 
| 140 | When i < MD_SB_DISKS && devname != NULL cycle | 
| 145 | p = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for | 
| 154 | If rdev Then dev = new_decode_dev(rdev) | 
| 156 | If Not dev Then | 
| 167 | If Not i Then Continue | 
| 175 | If fd < 0 Then | 
| 180 | If ksys_ioctl(fd, SET_ARRAY_INFO, 0) == -EBUSY Then | 
| 185 | Continue | 
| 192 | size = 0 | 
| 193 | nr_disks = 0 | 
| 194 | raid_disks = 0 | 
| 195 | When devices[raid_disks] cycle | 
| 196 | raid_disks++ | 
| 198 | not_persistent = 1 | 
| 200 | 1 State bits (clean, ...) = 1 << Superblock state bits | 
| 201 | 0 the array's physical layout = 0 | 
| 202 | 1 chunk size in bytes = chunk | 
| 203 | err = ksys_ioctl(fd, SET_ARRAY_INFO, (long) & ainfo) | 
| 204 | When Not err && i <= MD_SB_DISKS cycle | 
| 206 | If Not dev Then Break | 
| 210 | state = 1 << disk is running or spare disk | 1 << disk is in sync with the raid set | 
| 213 | err = ksys_ioctl(fd, ADD_NEW_DISK, (long) & dinfo) | 
| 216 | Else | 
| 218 | When i <= MD_SB_DISKS cycle | 
| 227 | If Not err Then err = ksys_ioctl(fd, usage , 0) | 
| 231 | Else | 
| 239 | ksys_ioctl(fd, -read partition table , 0) | 
| Name | Describe | 
|---|---|
| md_run_setup | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |