[linux-lvm] LVM with devfs

Luca Berra bluca at comedia.it
Tue Feb 27 22:42:26 UTC 2001


On Tue, Feb 27, 2001 at 02:36:04PM -0800, Ralph Jennings wrote:
> In case anybody cares, I have an experience here to share:
> 
> When I do a pvcreate on /dev/md/3 with devfs, pvcreate says file
> doesn't exist (talking about /dev/md/3).

patch for /proc/partitions attacched

> Also dies with /dev/discs/disc1/part1. (problem with symlinks?)
> When I use /dev/ide/host0/bus1/target0/lun0/part1 it works.
yes, it doesn't not follow symlinks

-- 
Luca Berra -- bluca at comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
-------------- next part --------------
--- linux-2.4.1-ac9/drivers/md/md.c.bluca.orig	Mon Feb 12 08:59:30 2001
+++ linux-2.4.1-ac9/drivers/md/md.c	Mon Feb 12 09:07:09 2001
@@ -3606,6 +3606,8 @@
 int md__init md_init (void)
 {
 	static char * name = "mdrecoveryd";
+	unsigned int minor;
+	char devname[128];
 	
 	printk (KERN_INFO "md driver %d.%d.%d MAX_MD_DEVS=%d, MD_SB_DISKS=%d\n",
 			MD_MAJOR_VERSION, MD_MINOR_VERSION,
@@ -3617,9 +3619,14 @@
 		return (-1);
 	}
 	devfs_handle = devfs_mk_dir (NULL, "md", NULL);
-	devfs_register_series (devfs_handle, "%u",MAX_MD_DEVS,DEVFS_FL_DEFAULT,
-				MAJOR_NR, 0, S_IFBLK | S_IRUSR | S_IWUSR,
-				&md_fops, NULL);
+	/* we don't use devfs_register_series because we want to fill md_hd_struct */
+	for (minor=0; minor < MAX_MD_DEVS; ++minor)
+	{
+		sprintf (devname, "%u", minor);
+		md_hd_struct[minor].de = devfs_register (devfs_handle,
+			devname, DEVFS_FL_DEFAULT, MAJOR_NR, minor,
+			S_IFBLK | S_IRUSR | S_IWUSR, &md_fops, NULL);
+	}
 
 	/* forward all md request to md_make_request */
 	blk_queue_make_request(BLK_DEFAULT_QUEUE(MAJOR_NR), md_make_request);


More information about the linux-lvm mailing list