And here is a some more extreme cleanup: It seems bigger as it is at first glance, however if you start to read it at ide.h, the rest should be, well, obivous... Anyway please let me explain some bits: the end_request() function familiy (not the global one, but the IDE specific ones), did bear a permuted parameter ordering. After fixing this it turned out that at all places the huk parameter wasn't the hwgroup, but just the drive in question itself. I have changed this to be more sane, which allowed to remove many unneccessary code duplication, or rather obfuscation, in between the __ide_end_request() and ide_end_request() functions. This simplification is actually the "spreading" part of the game. In a next step rather as much as possible should be moved from beeing hooked on the disk to be hooked on the request itself - which seems more natural and would make the overall code treamlined with other similar driver mid-layers (SCSI comes to mind). In a third step one should take care to remove the excessive usage of single linked lists inside the ide driver, where possible and make it be handled the same way like in SCSI and elsewere in the kernel... The overall perspecive is to make as much as possible common between all block device handlers no matter whatever SCSI/IDE/I2O or FW or iSCSI. I have taken as much care as possible to not break anything. In esp. it all has ben tested in life on my home system with L120 (aka ide-floppy), an CD-RW, and two disks. The only blind fly is ide-tape... but the patch can be easly verifyed for correctness by reading through it. PS. I have killed deliberately some one-shoot functions as well, since those where only obscuring the overall code structure even more....