Patch series to remove devfs [00/22]
As everyone knows[1], devfs is going to be removed from the kernel soon. To accomplish this, here is a series of patches (22 in all) that do just that. Surprisingly enough, devfs was almost everywhere in the kernel, that's why it takes so many patches :)
Anyway, here's the whole series against 2.6.12-rc6-git4. If some of them don't make it through to lkml (due to size restrictions, or just failing on a "taste" filter), you can find them all at:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/gregkh-05-devfs/
along with a quilt series file to apply them with.
Andrew, please do not pick these up for your -mm tree. Odds are it will just cause too many conflicts to make it worth your while :)
Comments welcome.
Oh, and the best part? Here's the summary of the diffstat:
222 files changed, 112 insertions(+), 8545 deletions(-)
It's nice to remove code from the kernel for a change...
thanks,
greg k-h
[1] What? You don't know this? Didn't you get the memo[2]? Did you miss the huge flame war almost a year ago[3]? Are you living under a rock[4]?
[2] http://lxr.linux.no/source/Documentation/feature-removal-schedule.txt
[3] http://thread.gmane.org/gmane.linux.kernel/219278
[4] http://www.balloonplanet.com/shop/images/products/product_1788_small.jpg
Quoted 3 lines · Greg KH
...
Comments welcome.
...
Please don't remove the !CONFIG_DEVFS_FS dummies from devfs_fs_kernel.h.
I'm sure some driver maintainers will want to keep the functions in their code because they share their drivers between 2.4 and 2.6 .
Keeping a devfs_fs_kernel.h with dummy functions doesn't hurt, but it prevents version #ifdef's in drivers and/or the same dummy functions in some subsystem specific headers.
Quoted 4 lines
thanks,
greg k-h
...
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 9 lines · Adrian Bunk
Quoted 3 lines · Greg KH
...
Comments welcome.
...Please don't remove the !CONFIG_DEVFS_FS dummies from
devfs_fs_kernel.h.I'm sure some driver maintainers will want to keep the functions in their code because they share their drivers between 2.4 and 2.6 .
All drivers should be in the mainline kernel tree, so why would they need this? Remember, out-of-the-tree drivers are on their own...
thanks,
greg k-h
Quoted 6 lines · Greg KH
Quoted 5 lines · Adrian Bunk
Quoted 3 lines · Greg KH
...
Comments welcome.
...
Quoted 7 lines
Quoted 4 lines
Please don't remove the !CONFIG_DEVFS_FS dummies from
devfs_fs_kernel.h.I'm sure some driver maintainers will want to keep the functions in their code because they share their drivers between 2.4 and 2.6 .
All drivers should be in the mainline kernel tree, so why would they need this? Remember, out-of-the-tree drivers are on their own...
I'm talking about drivers in the mainline kernel tree.
In some cases the driver author supports both 2.4 and 2.6 and prefers to support them in one file. Sometimes he submits the latest version of his driver to Marcelo or Linus.
If you remove the global function dummies, you force every driver maintainer who works this way to add the function dummies to their drivers.
Yes, there are many places where 2.4 and 2.6 are not source compatible for good reasons. But if the effort for maintaining compatibility between 2.4 and 2.6 in one area is as easy as keeping a header file with some dummy funtions it's worth considering.
And keeping the compatibility stuff in one file instead of spreaded through the kernel sources makes the cleanup to remove the last occurences a few years from now easier.
Quoted 3 lines
thanks,
greg k-h
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 4 lines · Adrian Bunk
Yes, there are many places where 2.4 and 2.6 are not source compatible for good reasons. But if the effort for maintaining compatibility between 2.4 and 2.6 in one area is as easy as keeping a header file with some dummy funtions it's worth considering.
The devfs calls for 2.4 and 2.6 are totally incompatible. And there's a trivial way to support both 2.4 and 2.6 in this area: don't support devfs at all, it always was marked either experimental or deprecated anyway.
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Adrian Bunk
Yes, there are many places where 2.4 and 2.6 are not source compatible for good reasons. But if the effort for maintaining compatibility between 2.4 and 2.6 in one area is as easy as keeping a header file with some dummy funtions it's worth considering.
The devfs calls for 2.4 and 2.6 are totally incompatible.
...
OK, it seems I've missed how much devfs changed during 2.5 times...
Simply discard my emails in this thread.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 25 lines · Adrian Bunk
Quoted 6 lines · Greg KH
Quoted 5 lines · Adrian Bunk
Quoted 3 lines · Greg KH
...
Comments welcome.
...Quoted 7 lines
Quoted 4 lines
Please don't remove the !CONFIG_DEVFS_FS dummies from
devfs_fs_kernel.h.I'm sure some driver maintainers will want to keep the functions in their code because they share their drivers between 2.4 and 2.6 .
All drivers should be in the mainline kernel tree, so why would they need this? Remember, out-of-the-tree drivers are on their own...
I'm talking about drivers in the mainline kernel tree.
In some cases the driver author supports both 2.4 and 2.6 and prefers to support them in one file. Sometimes he submits the latest version of his driver to Marcelo or Linus.
If you remove the global function dummies, you force every driver maintainer who works this way to add the function dummies to their drivers.
Quoted 8 lines
Yes, there are many places where 2.4 and 2.6 are not source compatible for good reasons. But if the effort for maintaining compatibility between 2.4 and 2.6 in one area is as easy as keeping a header file with some dummy funtions it's worth considering.
And keeping the compatibility stuff in one file instead of spreaded through the kernel sources makes the cleanup to remove the last occurences a few years from now easier.
How do these 2.4+2.6 drivers integrate with sysfs? Without proper 2.6-driver-core integration they will not work anyway.
Kay
PATCH 1/1 fix compile errors and warning after devfs removal patches
In reply to Greg KHThe patch below fixes three compile errors and one compile warning after applying the devfs removal patches.
---
drivers/ide/ide-tape.c | 1 - drivers/md/md.c | 1 - init/do_mounts_md.c | 2 +- init/do_mounts_rd.c | 4 ++-- 4 files changed, 3 insertions(+), 5 deletions(-)
init/do_mounts_rd.c renamed from init/do_mounts_rd.c.old +2 -2
@@ -262,8 +262,8 @@ {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" ); }
init/do_mounts_md.c renamed from init/do_mounts_md.c.old +1 -1
@@ -275,7 +275,7 @@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 {
drivers/ide/ide-tape.c renamed from drivers/ide/ide-tape.c.old +0 -1
@@ -4875,7 +4875,6 @@idetape_setup (drive, tape, minor); - g->number =-1 ; g->fops = &idetape_block_ops;ide_register_region (g);
drivers/md/md.c renamed from drivers/md/md.c.old +0 -1
@@ -3947,7 +3947,6 @@ {mddev_t *mddev;struct list_head *tmp; -int i;blk_unregister_region (MKDEV (MAJOR_NR ,0 ),MAX_MD_DEVS );blk_unregister_region (MKDEV (mdp_major,0 ),MAX_MD_DEVS << MdpMinorShift);
Re: [2.6 patch] fix compile errors and warning after devfs removal patches
Quoted 4 lines · Adrian Bunk
The patch below fixes three compile errors and one compile warning after applying the devfs removal patches.
Signed-off-by Adrian Bunk <[email protected]>
Thanks a lot, I've incorporated these into my patch series.
greg k-h
Quoted 5 lines · Greg KH
As everyone knows[1], devfs is going to be removed from the kernel soon. To accomplish this, here is a series of patches (22 in all) that do just that. Surprisingly enough, devfs was almost everywhere in the kernel, that's why it takes so many patches :)
You missed this for -mm, do not know if they apply to mainline:
drivers/scsi/ch.c renamed from drivers/scsi/ch.c.orig +0 -4
@@ -20,7 +20,6 @@#include <linux/interrupt.h> #include <linux/blkdev.h> #include <linux/completion.h> -#include <linux/devfs_fs_kernel.h> #include <linux/ioctl32.h> #include <linux/compat.h> #include <linux/chio.h> /* here are all the ioctls */
@@ -940,8 +939,6 @@if (init)ch_init_elem (ch); -devfs_mk_cdev (MKDEV (SCSI_CHANGER_MAJOR ,ch->minor), -S_IFCHR |S_IRUGO |S_IWUGO , ch->name);class_device_create (ch_sysfs_class,MKDEV (SCSI_CHANGER_MAJOR ,ch->minor), dev,"s%s" , ch->name);
@@ -974,7 +971,6 @@class_device_destroy (ch_sysfs_class,MKDEV (SCSI_CHANGER_MAJOR ,ch->minor)); -devfs_remove (ch->name);kfree (ch->dt);kfree (ch); ch_devcount--;
drivers/scsi/arcmsr/arcmsr.c renamed from drivers/scsi/arcmsr/arcmsr.c.orig +0 -2
@@ -101,7 +101,6 @@#include <linux/moduleparam.h> #include <linux/blkdev.h> #include <linux/timer.h> -#include <linux/devfs_fs_kernel.h> #include <linux/mc146818rtc.h> #include <linux/reboot.h> #include <linux/sched.h>
@@ -1654,7 +1653,6 @@ ** int attached; %% # of high level drivers attached to this %% ** int access_count; %% Count of open channels/mounts %% ** void *hostdata; %% available to low-level driver %% -** devfs_handle_t de; %% directory for the device %% ** char type; ** char scsi_level; ** char vendor[8], model[16], rev[4];
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam24 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))
Quoted 9 lines · J.A. Magallon
Quoted 5 lines · Greg KH
As everyone knows[1], devfs is going to be removed from the kernel soon. To accomplish this, here is a series of patches (22 in all) that do just that. Surprisingly enough, devfs was almost everywhere in the kernel, that's why it takes so many patches :)
You missed this for -mm, do not know if they apply to mainline:
This patch series was not for -mm, as my comments stated :)
But thanks for the patch anyway.
greg k-h
Quoted 9 lines · Greg KH
Quoted 8 lines · J.A. Magallon
Quoted 5 lines · Greg KH
As everyone knows[1], devfs is going to be removed from the kernel soon. To accomplish this, here is a series of patches (22 in all) that do just that. Surprisingly enough, devfs was almost everywhere in the kernel, that's why it takes so many patches :)
Quoted 4 lines
Quoted 1 line
You missed this for -mm, do not know if they apply to mainline:
This patch series was not for -mm, as my comments stated :)
I shifted some offsets and am running it now...
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam25 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))