函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:init\do_mounts_md.c Create Date:2022-07-27 15:21:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:md_setup_drive

函数原型:static void __init md_setup_drive(void)

返回类型:void

参数:

123 ent小于md_setup_ents循环
125  err等于0
130  minor等于minor
131  partitioned等于partitioned
132  devname等于device_names
134  输出格式化串
135  如果partitioneddev等于MKDEV(mdp_major, minor << 63 partitions with the alternate major number (mdp) )
137  否则dev等于MKDEV(MD_MAJOR, minor)
139  create_dev(name, dev)
140 i < MD_SB_DISKS && devname != NULL循环
146  如果pp自加等于0
150  如果字符串指定长度比较恒等于0则devname加等于5
153  rdev等于bstat(comp_name)
154  如果rdevdev等于new_decode_dev(rdev)
156  如果非dev
161  devices[i]等于dev
163  devname等于p
165  devices[i]等于0
167  如果非i则继续下一循环
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  如果fd小于0则
178  继续下一循环
180  如果ksys_ioctl(fd, SET_ARRAY_INFO, 0)恒等于负EBUSY
185  继续下一循环
191  level等于level
192  size等于0
193  nr_disks等于0
194  raid_disks等于0
196  raid_disks自加
197  md_minor等于minor
198  not_persistent等于1
203  err等于ksys_ioctl(fd, SET_ARRAY_INFO, (long) & ainfo)
204  以非erri小于等于MD_SB_DISKS循环
205  dev等于devices[i]
206  如果非dev退出
209  raid_disk等于i
211  major等于MAJOR(dev)
212  minor等于MINOR(dev)
213  err等于ksys_ioctl(fd, ADD_NEW_DISK, (long) & dinfo)
216  否则
218 i小于等于MD_SB_DISKS循环
219  dev等于devices[i]
220  如果非dev退出
222  major等于MAJOR(dev)
223  minor等于MINOR(dev)
224  ksys_ioctl(fd, ADD_NEW_DISK, (long) & dinfo)
227  如果非errerr等于ksys_ioctl(fd, usage , 0)
229  如果errprintk - 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  否则
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().
调用者
名称描述
md_run_setup