kernels/linux-2.4.0/fs/partitions/msdos.c
/*
 * Create devices for Unixware partitions listed in a disklabel, under a
 * dos-like partition. See extended_partition() for more information.
 */
Create devices for Unixware partitions listed in a disklabel, under a
dos-like partition. See extended_partition() for more information.
Create devices for Unixware partitions listed in a disklabel under a dos - like partition . See extended_partition () for more information .
static void unixware_partition(struct gendisk *hd, int minor) {
	struct buffer_head *bh;
	struct unixware_disklabel *l;
	struct unixware_slice *p;
	int mask = (1 << hd->minor_shift) - 1;
	char buf[40];
	if (!(bh = get_partition_table_block(hd, minor, 14)))
		return;
	l = (struct unixware_disklabel *) (bh->b_data+512);
	if (le32_to_cpu(l->d_magic) != UNIXWARE_DISKMAGIC ||
	    le32_to_cpu(l->vtoc.v_magic) != UNIXWARE_DISKMAGIC2) {
		brelse(bh);
		return;
	}
	printk(" %s: <unixware:", disk_name(hd, minor, buf));
	p = &l->vtoc.v_slice[1];
	while (p - &l->vtoc.v_slice[0] < UNIXWARE_NUMSLICE) {
		if ((current_minor & mask) == 0)
			break;
		if (p->s_label != UNIXWARE_FS_UNUSED) {
			add_gd_partition(hd, current_minor, START_SECT(p),
					 NR_SECTS(p));
			current_minor++;
		}
		p++;
	}
	bforget(bh);
	printk(" >\n");
}
static void unixware_partition ( struct gendisk * hd , int minor ) { struct buffer_head * bh ; struct unixware_disklabel * l ; struct unixware_slice * p ; int mask = ( 1 << hd -> minor_shift ) - 1 ; char buf [ 40 ] ; if ( ! ( bh = get_partition_table_block ( hd , minor , 14 ) ) ) return ; l = ( struct unixware_disklabel * ) ( bh -> b_data + 512 ) ; if ( le32_to_cpu ( l -> d_magic ) != UNIXWARE_DISKMAGIC || le32_to_cpu ( l -> vtoc . v_magic ) != UNIXWARE_DISKMAGIC2 ) { brelse ( bh ) ; return ; } printk ( " " , disk_name ( hd , minor , buf ) ) ; p = & l -> vtoc . v_slice [ 1 ] ; while ( p - & l -> vtoc . v_slice [ 0 ] < UNIXWARE_NUMSLICE ) { if ( ( current_minor & mask ) == 0 ) break ; if ( p -> s_label != UNIXWARE_FS_UNUSED ) { add_gd_partition ( hd , current_minor , START_SECT ( p ) , NR_SECTS ( p ) ) ; current_minor ++ ; } p ++ ; } bforget ( bh ) ; printk ( " \n " ) ; }
Create devices for Unixware partitions listed in a disklabel, under a
 dos-like partition.
Create devices for Unixware partitions listed in a disklabel under a dos - like partition .
/* I omit the 0th slice as it is the same as whole disk. */ /* Use bforget, as we have changed the disk setup */