// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> #include <linux/blkdev.h> #include <linux/init.h> #include <linux/mount.h> #include <linux/major.h> #include <linux/delay.h> #include <linux/init_syscalls.h> #include <linux/raid/detect.h> #include <linux/raid/md_u.h> #include <linux/raid/md_p.h> #include "md.h" /* * When md (and any require personalities) are compiled into the kernel * (not a module), arrays can be assembles are boot time using with AUTODETECT * where specially marked partitions are registered with md_autodetect_dev(), * and with MD_BOOT where devices to be collected are given on the boot line * with md=..... * The code for that is here. */ #ifdef CONFIG_MD_AUTODETECT static int __initdata raid_noautodetect; #else static int __initdata raid_noautodetect=1; #endif static int __initdata raid_autopart; static struct md_setup_args { … } md_setup_args[256] __initdata; static int md_setup_ents __initdata; /* * Parse the command-line parameters given our kernel, but do not * actually try to invoke the MD device now; that is handled by * md_setup_drive after the low-level disk drivers have initialised. * * 27/11/1999: Fixed to work correctly with the 2.3 kernel (which * assigns the task of parsing integer arguments to the * invoked program now). Added ability to initialise all * the MD devices (by specifying multiple "md=" lines) * instead of just one. -- KTK * 18May2000: Added support for persistent-superblock arrays: * md=n,0,factor,fault,device-list uses RAID0 for device n * md=n,device-list reads a RAID superblock from the devices * elements in device-list are read by name_to_kdev_t so can be * a hex number or something like /dev/hda1 /dev/sdb * 2001-06-03: Dave Cinege <[email protected]> * Shifted name_to_kdev_t() and related operations to md_set_drive() * for later execution. Rewrote section to make devfs compatible. */ static int __init md_setup(char *str) { … } static void __init md_setup_drive(struct md_setup_args *args) { … } static int __init raid_setup(char *str) { … } __setup(…); __setup(…); static void __init autodetect_raid(void) { … } void __init md_run_setup(void) { … }