Just like the NFS and CIFS root code this better lives with the driver it is tightly integrated with.
Unified · Split
| @@ -43,6 +43,9 @@ obj-$(CONFIG_MD_FAULTY) += faulty.o · 42 unmodified lines | |||
| 43 | obj-$(CONFIG_MD_CLUSTER) += md-cluster.o | 43 | obj-$(CONFIG_MD_CLUSTER) += md-cluster.o |
| 44 | obj-$(CONFIG_BCACHE) += bcache/ | 44 | obj-$(CONFIG_BCACHE) += bcache/ |
| 45 | obj-$(CONFIG_BLK_DEV_MD) += md-mod.o | 45 | obj-$(CONFIG_BLK_DEV_MD) += md-mod.o |
| 46 | ifeq ($(CONFIG_BLK_DEV_MD),y) | ||
| 47 | obj-y += md-autodetect.o | ||
| 48 | endif | ||
| 46 | obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o | 49 | obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o |
| 47 | obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o | 50 | obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o |
| 48 | obj-$(CONFIG_DM_UNSTRIPED) += dm-unstripe.o | 51 | obj-$(CONFIG_DM_UNSTRIPED) += dm-unstripe.o |
| @@ -1,10 +1,15 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | #include <linux/kernel.h> | ||
| 3 | #include <linux/blkdev.h> | ||
| 4 | #include <linux/init.h> | ||
| 5 | #include <linux/syscalls.h> | ||
| 6 | #include <linux/mount.h> | ||
| 7 | #include <linux/major.h> | ||
| 2 | #include <linux/delay.h> | 8 | #include <linux/delay.h> |
| 9 | #include <linux/raid/detect.h> | ||
| 3 | #include <linux/raid/md_u.h> | 10 | #include <linux/raid/md_u.h> |
| 4 | #include <linux/raid/md_p.h> | 11 | #include <linux/raid/md_p.h> |
| 5 | 12 | ||
| 6 | #include "do_mounts.h" | ||
| 7 | |||
| 8 | /* | 13 | /* |
| 9 | * When md (and any require personalities) are compiled into the kernel | 14 | * When md (and any require personalities) are compiled into the kernel |
| 10 | * (not a module), arrays can be assembles are boot time using with AUTODETECT | 15 | * (not a module), arrays can be assembles are boot time using with AUTODETECT |
| @@ -114,6 +119,12 @@ static int __init md_setup(char *str) · 103 unmodified lines | |||
| 114 | return 1; | 119 | return 1; |
| 115 | } | 120 | } |
| 116 | 121 | ||
| 122 | static inline int create_dev(char *name, dev_t dev) | ||
| 123 | { | ||
| 124 | ksys_unlink(name); | ||
| 125 | return ksys_mknod(name, S_IFBLK|0600, new_encode_dev(dev)); | ||
| 126 | } | ||
| 127 | |||
| 117 | static void __init md_setup_drive(void) | 128 | static void __init md_setup_drive(void) |
| 118 | { | 129 | { |
| 119 | int minor, i, ent, partitioned; | 130 | int minor, i, ent, partitioned; |
| @@ -1,3 +1,11 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | 2 | ||
| 3 | void md_autodetect_dev(dev_t dev); | 3 | void md_autodetect_dev(dev_t dev); |
| 4 | |||
| 5 | #ifdef CONFIG_BLK_DEV_MD | ||
| 6 | void md_run_setup(void); | ||
| 7 | #else | ||
| 8 | static inline void md_run_setup(void) | ||
| 9 | { | ||
| 10 | } | ||
| 11 | #endif | ||
| @@ -18,7 +18,6 @@ obj-y += init_task.o · 17 unmodified lines | |||
| 18 | mounts-y := do_mounts.o | 18 | mounts-y := do_mounts.o |
| 19 | mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o | 19 | mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o |
| 20 | mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o | 20 | mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o |
| 21 | mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o | ||
| 22 | 21 | ||
| 23 | # dependencies on generated files need to be listed explicitly | 22 | # dependencies on generated files need to be listed explicitly |
| 24 | $(obj)/version.o: include/generated/compile.h | 23 | $(obj)/version.o: include/generated/compile.h |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include <linux/nfs_fs.h> | 23 | #include <linux/nfs_fs.h> |
| 24 | #include <linux/nfs_fs_sb.h> | 24 | #include <linux/nfs_fs_sb.h> |
| 25 | #include <linux/nfs_mount.h> | 25 | #include <linux/nfs_mount.h> |
| 26 | #include <linux/raid/detect.h> | ||
| 26 | #include <uapi/linux/mount.h> | 27 | #include <uapi/linux/mount.h> |
| 27 | 28 | ||
| 28 | #include "do_mounts.h" | 29 | #include "do_mounts.h" |
| @@ -41,13 +41,3 @@ bool __init initrd_load(void); · 40 unmodified lines | |||
| 41 | static inline bool initrd_load(void) { return false; } | 41 | static inline bool initrd_load(void) { return false; } |
| 42 | 42 | ||
| 43 | #endif | 43 | #endif |
| 44 | |||
| 45 | #ifdef CONFIG_BLK_DEV_MD | ||
| 46 | |||
| 47 | void md_run_setup(void); | ||
| 48 | |||
| 49 | #else | ||
| 50 | |||
| 51 | static inline void md_run_setup(void) {} | ||
| 52 | |||
| 53 | #endif | ||