From 1797a796c7333ed02bfd8883bbaafaec867ddeb2 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 18 Feb 2004 04:51:58 -0800 Subject: [PATCH] md: Allow partitioning of MD devices. From: NeilBrown With this patch, md used two major numbers for arrays. One Major is number 9 with name 'md' have unpartitioned md arrays, one per minor number. The other Major is allocated dynamically with name 'mdp' and had on array for every 64 minors, allowing for upto 63 partitions. The arrays under one major are completely separate from the arrays under the other. The preferred name for devices with the new major are of the form: /dev/md/d1p3 # partion 3 of device 1 - minor 67 When a paritioned md device is assembled, the partitions are not recognised until after the whole-array device is opened again. A future version of mdadm will perform this open so that the need will be transparent. --- include/linux/raid/md_k.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'include/linux/raid') diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index a89da5378b5f..1e0357ee40d8 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -186,7 +186,8 @@ struct mddev_s { void *private; mdk_personality_t *pers; - int __minor; + dev_t unit; + int md_minor; struct list_head disks; int sb_dirty; int ro; @@ -235,6 +236,7 @@ struct mddev_s struct semaphore reconfig_sem; atomic_t active; + int changed; /* true if we might need to reread partition info */ int degraded; /* whether md should consider * adding a spare */ @@ -272,15 +274,6 @@ struct mdk_personality_s }; -/* - * Currently we index md_array directly, based on the minor - * number. This will have to change to dynamic allocation - * once we start supporting partitioning of md devices. - */ -static inline int mdidx (mddev_t * mddev) -{ - return mddev->__minor; -} static inline char * mdname (mddev_t * mddev) { return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; -- cgit v1.2.3