Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

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
130  minor = minor
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) )
137  Else dev = MKDEV(MD_MAJOR, minor)
139  create_dev(name, dev)
140  When i < MD_SB_DISKS && devname != NULL cycle
146  If p Then p++ = 0
150  If strncmp(devname, "/dev/", 5) == 0 Then devname += 5
153  rdev = bstat(comp_name)
154  If rdev Then dev = new_decode_dev(rdev)
156  If Not dev Then
161  devices[i] = dev
163  devname = p
165  devices[i] = 0
167  If Not i Then Continue
170  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
174  fd = ksys_open(name, 0, 0)
175  If fd < 0 Then
178  Continue
180  If ksys_ioctl(fd, SET_ARRAY_INFO, 0) == -EBUSY Then
185  Continue
191  level = level
192  size = 0
193  nr_disks = 0
194  raid_disks = 0
195  When devices[raid_disks] cycle
196  raid_disks++
197  md_minor = minor
198  not_persistent = 1
203  err = ksys_ioctl(fd, SET_ARRAY_INFO, (long) & ainfo)
204  When Not err && i <= MD_SB_DISKS cycle
216  Else
218  When i <= MD_SB_DISKS cycle
219  dev = devices[i]
220  If Not dev Then Break
222  major = MAJOR(dev)
223  minor = MINOR(dev)
224  ksys_ioctl(fd, ADD_NEW_DISK, (long) & dinfo)
227  If Not err Then err = ksys_ioctl(fd, usage , 0)
229  If err Then 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
231  Else
238  fd = ksys_open(name, 0, 0)
241  In contrast to sys_close(), this stub does not check whether the syscall* should or should not be restarted, but returns the raw error codes from* __close_fd().
Caller
NameDescribe
md_run_setup