diff options
author | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-02-22 03:35:18 -0600 |
---|---|---|
committer | Kai Germaschewski <kai@tp1.ruhr-uni-bochum.de> | 2003-02-22 03:35:18 -0600 |
commit | b776ff473708482d817c4f8d8e314dfa0134a9a4 (patch) | |
tree | a95e70a8fcbd686c0e39c7796269bbce4c8d5b46 /init | |
parent | 0036dac90ace2f65050fe39f98bf1ec84d6c7c44 (diff) | |
download | history-b776ff473708482d817c4f8d8e314dfa0134a9a4.tar.gz |
do_mounts: create_dev() before mounting
The only path where the /dev/root created by prepare_namespace() wouldn't
be overwritten by a later create_dev() call is mount_nfs_root(), so move
it there, so that all the create_dev() calls are now next to the
actual mount. Also simplify mount_root() a little.
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c index 7408a883890d8b..67f18df0bad66d 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -279,6 +279,7 @@ static int __init mount_nfs_root(void) { void *data = nfs_root_data(); + create_dev("/dev/root", ROOT_DEV, NULL); if (data && do_mount_root("/dev/root", "nfs", root_mountflags, data) == 0) return 1; @@ -327,19 +328,19 @@ void __init mount_root(void) ROOT_DEV = Root_FD0; } #endif - create_dev("/dev/root", ROOT_DEV, root_device_name); #ifdef CONFIG_BLK_DEV_FD if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) { /* rd_doload is 2 for a dual initrd/ramload setup */ if (rd_doload==2) { if (rd_load_disk(1)) { ROOT_DEV = Root_RAM1; - create_dev("/dev/root", ROOT_DEV, NULL); + root_device_name = NULL; } } else change_floppy("root floppy"); } #endif + create_dev("/dev/root", ROOT_DEV, root_device_name); mount_block_root("/dev/root", root_mountflags); } @@ -363,8 +364,6 @@ void __init prepare_namespace(void) is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; - create_dev("/dev/root", ROOT_DEV, NULL); - /* This has to be before mounting root, because even readonly mount of reiserfs would replay log corrupting stuff */ software_resume(); |