From d0dbcf1f4d24fec513176a80379d60f20f4630d7 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Tue, 4 May 1999 15:30:41 +0000 Subject: 1999-04-28 OKUJI Yoshinori * linux/dev/drivers/block/genhd.c (bsd_disklabel_partition) [MACH]: Print BSD slices, using Mach device syntax instead of Linux extented partition syntax. --- linux/dev/drivers/block/genhd.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'linux/dev/drivers') diff --git a/linux/dev/drivers/block/genhd.c b/linux/dev/drivers/block/genhd.c index 37c41a6..a499698 100644 --- a/linux/dev/drivers/block/genhd.c +++ b/linux/dev/drivers/block/genhd.c @@ -240,6 +240,37 @@ static void bsd_disklabel_partition(struct gendisk *hd, kdev_t dev) p = &l->d_partitions[0]; while (p - &l->d_partitions[0] <= BSD_MAXPARTITIONS) { +#ifdef MACH + /* Print BSD slices like hd0s1a (Mach syntax) instead of hd0s5 + (Linux syntax), and do not add them into HD. In Mach, + the partitions of HD will not be used anyway. */ + if (p->p_fstype != BSD_FS_UNUSED) + { + unsigned int part = current_minor & mask; + const char *maj = hd->major_name; + char unit = (current_minor >> hd->minor_shift) + '0'; + char slice = p - &l->d_partitions[0] + 'a'; + +#ifdef CONFIG_BLK_DEV_IDE + switch (hd->major) + { + case IDE3_MAJOR: + unit += 2; + case IDE2_MAJOR: + unit += 2; + case IDE1_MAJOR: + unit += 2; + case IDE0_MAJOR: + maj = "hd"; + } +#endif + if (part) + printk (" %s%cs%d%c", maj, unit, part, slice); + else + printk (" %s%c%c", maj, unit, slice); + } + p++; +#else /* ! MACH */ if ((current_minor & mask) >= (4 + hd->max_p)) break; @@ -248,6 +279,7 @@ static void bsd_disklabel_partition(struct gendisk *hd, kdev_t dev) current_minor++; } p++; +#endif /* ! MACH */ } brelse(bh); -- cgit v1.2.3