Skip to contentSkip to conversation

remove compat code for old devfs naming scheme

PATCH In review Christoph Hellwig 2 participants 6 messages May 14, 2002 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove compat code for old devfs naming scheme

Hi Richard,

current init/do_mounts.c contains the devfs_make_root/convert_name functions which provide compatiblility for the old, pre kernel-merge devfs naming scheme in the root= kernel command line.

As this was never present in official kernels there is really no need in keeping it - it just bloats the kernel.

Could you please forward this patch to Linus and maybe Marcelo with your next devfs update?

Christoph

--

init/do_mounts.c +0 -58
@@ -636,63 +636,6 @@
 	return rd_load_image("/dev/root");
 }
 
-#ifdef CONFIG_DEVFS_FS
-
-static void __init convert_name(char *prefix, char *name, char *p, int part)
-{
-	int host, bus, target, lun;
-	char dest[64];
-	char src[64];
-	char *base = p - 1;
-
-	/*  Decode "c#b#t#u#"  */
-	if (*p++ != 'c')
-		return;
-	host = simple_strtol(p, &p, 10);
-	if (*p++ != 'b')
-		return;
-	bus = simple_strtol(p, &p, 10);
-	if (*p++ != 't')
-		return;
-	target = simple_strtol(p, &p, 10);
-	if (*p++ != 'u')
-		return;
-	lun = simple_strtol(p, &p, 10);
-	if (!part)
-		sprintf(dest, "%s/host%d/bus%d/target%d/lun%d",
-				prefix, host, bus, target, lun);
-	else if (*p++ == 'p')
-		sprintf(dest, "%s/host%d/bus%d/target%d/lun%d/part%s",
-				prefix, host, bus, target, lun, p);
-	else
-		sprintf(dest, "%s/host%d/bus%d/target%d/lun%d/disc",
-				prefix, host, bus, target, lun);
-	*base = '\0';
-	sprintf(src, "/dev/%s", name);
-	sys_mkdir(src, 0755);
-	*base = '/';
-	sprintf(src, "/dev/%s", name);
-	sys_symlink(dest, src);
-}
-
-static void __init devfs_make_root(char *name)
-{
-
-	if (!strncmp(name, "sd/", 3))
-		convert_name("../scsi", name, name+3, 1);
-	else if (!strncmp(name, "sr/", 3))
-		convert_name("../scsi", name, name+3, 0);
-	else if (!strncmp(name, "ide/hd/", 7))
-		convert_name("..", name, name + 7, 1);
-	else if (!strncmp(name, "ide/cd/", 7))
-		convert_name("..", name, name + 7, 0);
-}
-#else
-static void __init devfs_make_root(char *name)
-{
-}
-#endif
-
 static void __init mount_root(void)
 {
 #ifdef CONFIG_ROOT_NFS
@@ -707,7 +650,6 @@
 		ROOT_DEV = mk_kdev(FLOPPY_MAJOR, 0);
 	}
 #endif
-	devfs_make_root(root_device_name);
 	create_dev("/dev/root", ROOT_DEV, root_device_name);
 #ifdef CONFIG_BLK_DEV_FD
 	if (major(ROOT_DEV) == FLOPPY_MAJOR) {
#1 lore raw
Quoted 11 lines · Christoph Hellwig

Hi Richard,

current init/do_mounts.c contains the devfs_make_root/convert_name functions which provide compatiblility for the old, pre kernel-merge devfs naming scheme in the root= kernel command line.

As this was never present in official kernels there is really no need in keeping it - it just bloats the kernel.

Could you please forward this patch to Linus and maybe Marcelo with your next devfs update?

What on earth are you talking about? This code has been in the kernel since 2.3.46. It's just lived in a different place: fs/devfs/util.c.

And FYI: 2.5.x kernels *are* official!

				Regards,

					Richard....
Permanent: [email protected]
Current:   [email protected]
#2 lore raw
In reply to Christoph Hellwig
Quoted 9 lines · Richard Gooch
Quoted 5 lines

As this was never present in official kernels there is really no need in keeping it - it just bloats the kernel.

Could you please forward this patch to Linus and maybe Marcelo with your next devfs update?

What on earth are you talking about? This code has been in the kernel since 2.3.46. It's just lived in a different place: fs/devfs/util.c.

Of course this code was present, otherwise it would be rather hard to remove it..

But the old devfs naming scheme was obsolete before devfs was merged in 2.3.46 so there is no valid reason to support it for root=.

#3 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 6 lines · Richard Gooch
Quoted 5 lines

As this was never present in official kernels there is really no need in keeping it - it just bloats the kernel.

Could you please forward this patch to Linus and maybe Marcelo with your next devfs update?

Quoted 8 lines
Quoted 2 lines

What on earth are you talking about? This code has been in the kernel since 2.3.46. It's just lived in a different place: fs/devfs/util.c.

Of course this code was present, otherwise it would be rather hard to remove it..

But the old devfs naming scheme was obsolete before devfs was merged in 2.3.46 so there is no valid reason to support it for root=.

The reason to support it is because lots of people are depending on it. A lot of systems would break for no real gain. This code is in the init section, so the memory will be freed before init(8) starts.

The code should stay. In 2.5, I can move it into the mini devfsd that will go into the initial rootfs.

				Regards,

					Richard....
Permanent: [email protected]
Current:   [email protected]
#4 lore raw
In reply to Christoph Hellwig
Quoted 6 lines · Richard Gooch

The reason to support it is because lots of people are depending on it. A lot of systems would break for no real gain. This code is in the init section, so the memory will be freed before init(8) starts.

The code should stay. In 2.5, I can move it into the mini devfsd that will go into the initial rootfs.

Exactly how many system exist which

a) still use the two or three year old devfs naming scheme for their root= command line
b) use current 2.5 kernels

and

c) have users not capable of translating that syntax to either the new devfs or traditional Linux syntax?

I don't think there are more then about ten, and no I _absolutely_ do not consider that a reason to bloat the kernel, even if it is just source and image bloat.

#5 lore raw
Quoted 5 lines · Christoph Hellwig
Quoted 4 lines · Richard Gooch

The reason to support it is because lots of people are depending on it. A lot of systems would break for no real gain. This code is in the init section, so the memory will be freed before init(8) starts.

Quoted 8 lines
Quoted 2 lines

The code should stay. In 2.5, I can move it into the mini devfsd that will go into the initial rootfs.

Exactly how many system exist which

a) still use the two or three year old devfs naming scheme for their root= command line
b) use current 2.5 kernels

Those names are not really "old", but convenient shorthand. And it's more systems than you think.

Quoted 8 lines

and

c) have users not capable of translating that syntax to either the new devfs or traditional Linux syntax?

I don't think there are more then about ten, and no I _absolutely_ do not consider that a reason to bloat the kernel, even if it is just source and image bloat.

A lot more people are using devfs than you realise. Removing the code would screw them over. Leave it alone.

				Regards,

					Richard....
Permanent: [email protected]
Current:   [email protected]