Skip to content

Commit

Permalink
[PATCH] devfs: Remove devfs from the init code
Browse files Browse the repository at this point in the history
This patch removes the devfs code from the init/ directory.

Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jun 26, 2006
1 parent a296418 commit bdaf852
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 172 deletions.
4 changes: 0 additions & 4 deletions include/linux/devfs_fs_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,4 @@ static inline int devfs_register_tape(const char *name)
static inline void devfs_unregister_tape(int num)
{
}
static inline void mount_devfs_fs(void)
{
return;
}
#endif /* _LINUX_DEVFS_FS_KERNEL_H */
1 change: 0 additions & 1 deletion init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ obj-y := main.o version.o mounts.o initramfs.o
obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o

mounts-y := do_mounts.o
mounts-$(CONFIG_DEVFS_FS) += do_mounts_devfs.o
mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
mounts-$(CONFIG_BLK_DEV_MD) += do_mounts_md.o
Expand Down
8 changes: 2 additions & 6 deletions init/do_mounts.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ static int __init mount_nfs_root(void)
{
void *data = nfs_root_data();

create_dev("/dev/root", ROOT_DEV, NULL);
create_dev("/dev/root", ROOT_DEV);
if (data &&
do_mount_root("/dev/root", "nfs", root_mountflags, data) == 0)
return 1;
Expand Down Expand Up @@ -386,7 +386,7 @@ void __init mount_root(void)
change_floppy("root floppy");
}
#endif
create_dev("/dev/root", ROOT_DEV, root_device_name);
create_dev("/dev/root", ROOT_DEV);
mount_block_root("/dev/root", root_mountflags);
}

Expand All @@ -397,8 +397,6 @@ void __init prepare_namespace(void)
{
int is_floppy;

mount_devfs();

if (root_delay) {
printk(KERN_INFO "Waiting %dsec before mounting root device...\n",
root_delay);
Expand Down Expand Up @@ -428,10 +426,8 @@ void __init prepare_namespace(void)

mount_root();
out:
umount_devfs("/dev");
sys_mount(".", "/", NULL, MS_MOVE, NULL);
sys_chroot(".");
security_sb_post_mountroot();
mount_devfs_fs ();
}

15 changes: 1 addition & 14 deletions init/do_mounts.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,12 @@ void mount_root(void);
extern int root_mountflags;
extern char *root_device_name;

#ifdef CONFIG_DEVFS_FS

void mount_devfs(void);
void umount_devfs(char *path);
int create_dev(char *name, dev_t dev, char *devfs_name);

#else

static inline void mount_devfs(void) {}
static inline void umount_devfs(const char *path) {}

static inline int create_dev(char *name, dev_t dev, char *devfs_name)
static inline int create_dev(char *name, dev_t dev)
{
sys_unlink(name);
return sys_mknod(name, S_IFBLK|0600, new_encode_dev(dev));
}

#endif

#if BITS_PER_LONG == 32
static inline u32 bstat(char *name)
{
Expand Down
137 changes: 0 additions & 137 deletions init/do_mounts_devfs.c

This file was deleted.

6 changes: 2 additions & 4 deletions init/do_mounts_initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void __init handle_initrd(void)
int pid;

real_root_dev = new_encode_dev(ROOT_DEV);
create_dev("/dev/root.old", Root_RAM0, NULL);
create_dev("/dev/root.old", Root_RAM0);
/* mount initrd on rootfs' /root */
mount_block_root("/dev/root.old", root_mountflags & ~MS_RDONLY);
sys_mkdir("/old", 0700);
Expand All @@ -54,7 +54,6 @@ static void __init handle_initrd(void)
sys_chdir("/root");
sys_mount(".", "/", NULL, MS_MOVE, NULL);
sys_chroot(".");
mount_devfs_fs ();

current->flags |= PF_NOFREEZE;
pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
Expand All @@ -71,7 +70,6 @@ static void __init handle_initrd(void)
sys_chroot(".");
sys_close(old_fd);
sys_close(root_fd);
umount_devfs("/old/dev");

if (new_decode_dev(real_root_dev) == Root_RAM0) {
sys_chdir("/old");
Expand Down Expand Up @@ -107,7 +105,7 @@ static void __init handle_initrd(void)
int __init initrd_load(void)
{
if (mount_initrd) {
create_dev("/dev/ram", Root_RAM0, NULL);
create_dev("/dev/ram", Root_RAM0);
/*
* Load the initrd data into /dev/ram0. Execute it as initrd
* unless /dev/ram0 is supposed to be our actual root device,
Expand Down
7 changes: 3 additions & 4 deletions init/do_mounts_md.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,18 @@ static void __init md_setup_drive(void)
int err = 0;
char *devname;
mdu_disk_info_t dinfo;
char name[16], devfs_name[16];
char name[16];

minor = md_setup_args[ent].minor;
partitioned = md_setup_args[ent].partitioned;
devname = md_setup_args[ent].device_names;

sprintf(name, "/dev/md%s%d", partitioned?"_d":"", minor);
sprintf(devfs_name, "/dev/md/%s%d", partitioned?"d":"", minor);
if (partitioned)
dev = MKDEV(mdp_major, minor << MdpMinorShift);
else
dev = MKDEV(MD_MAJOR, minor);
create_dev(name, dev, devfs_name);
create_dev(name, dev);
for (i = 0; i < MD_SB_DISKS && devname != 0; i++) {
char *p;
char comp_name[64];
Expand Down Expand Up @@ -272,7 +271,7 @@ __setup("md=", md_setup);

void __init md_run_setup(void)
{
create_dev("/dev/md0", MKDEV(MD_MAJOR, 0), "md/0");
create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
if (raid_noautodetect)
printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
else {
Expand Down
4 changes: 2 additions & 2 deletions init/do_mounts_rd.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ int __init rd_load_disk(int n)
{
if (rd_prompt)
change_floppy("root floppy disk to be loaded into RAM disk");
create_dev("/dev/root", ROOT_DEV, root_device_name);
create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n), NULL);
create_dev("/dev/root", ROOT_DEV);
create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n));
return rd_load_image("/dev/root");
}

Expand Down

0 comments on commit bdaf852

Please sign in to comment.