"Heinz J. Mauelshagen" wrote: > > On Wed, Nov 22, 2000 at 04:27:51PM -0500, Brian Kress wrote: > > "Heinz J. Mauelshagen" wrote: > > > > > > On Wed, Nov 22, 2000 at 04:05:39PM -0500, Brian Kress wrote: > > > > Question about /proc/partitions and LVM. LVM devices in > > > > /proc/partitions currently show up as lvma, lvmb, etc, depending on > > > > their device number. This breaks things like mount by filesystem > > > > name. Back when LVM existed as a patch, I believe there was some > > > > support in fs/partitions/check.c for showing the proper name for > > > > the device (something like /). > > > > > > Yes. > > > It actually was /. > > > > > > Linus didn't accept it though. > > > > > > The code is still available in case he changes his mind. > > > > Yes, I can see that now looking through lvm.c. (LVM_HD_NAME) > > I'm guessing why he didn't take it is the minor hack of adding a > > function pointer to genhd.c as a special case just for LVM. > > A general solution to this problem would be nice. The > > big switch statement in disk_name in fs/paritions/check.c is kind > > of ugly as it has generic code have to know things about specific > > drivers. > > Yep. > > > How's this for an idea to generalize this. Put a function > > pointer in the gendisk structure for a specific function to call > > for disk_name for disks for that gendisk. > > Sounds resonable to me. > > > That way, LVM gets its > > /, IDE gets its two disks per major (special cased > > right now), all the other special cases get what they need and future > > drivers can call their devices whatever they like without touching > > this file. Makes the whole thing more modular. Make a NULL for > > this function default to the old a, b, etc. > > What to people think about this? If this sounds reasonable > > I can come up with a patch. > > Very good. I'ld appreciate it. > OK, here's the patch. It has three sets of changes: 1) Add a function pointer to struct gendisk called hd_name. 2) Make disk_name in fs/partitions/check.c use that function pointer if its non-null. 3) Change the following drivers to use this method. (adding the driver specific method and removing the old code in check.c) drivers/md/lvm.c drivers/md/md.c drivers/ide/ide-probe.c drivers/scsi/sd.c drivers/block/cpqarray.c drivers/block/cciss.c drivers/block/DAC960.c Let me know what you think. Think there's any chance we can get this in the main kernel tree? Brian Kress kressb@fsc-usa.com