vtoc.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* VTOC class implementation file.
*/
#include "vtoc.h"
static const int DEFAULT_SOLARIS_BASE_PARTITION = 2;
/*
* Declarations of private methods
*/
static boolean_t
int partition_number_1,
int partition_number_2);
/*
* Definitions of public methods
*/
int
{
/*
* Return the partition number of the largest partition
* that starts at byte 0 of the medium.
*/
int base_partition;
int test_partition;
/*
* Find the first partition that starts at byte 0 of the medium.
*/
test_partition = 0;
while ((test_partition < V_NUMPAR) &&
}
/*
* Look for higher-numbered partitions that also start at
* byte 0 of the medium and are larger than the first
* partition that starts at byte 0.
*/
while (test_partition < V_NUMPAR) {
}
}
/*
* If unable to find a partition starting at byte 0 of the
* medium, set the base partition number to -1. Otherwise,
* if the default Solaris base partition is identical to
* the base partition found using the algorithm above, set
* the base partition number to the default Solaris base
* partition number.
*/
if (base_partition == V_NUMPAR) {
base_partition = -1;
} else if (duplicates(vtocp,
}
return (base_partition);
}
{
int partition_number;
int possible_duplicate;
number_of_partitions = 0;
partition_number = 0;
while (partition_number < V_NUMPAR) {
}
}
/*
* Subtract duplicates
*/
partition_number = 0;
while (partition_number < V_NUMPAR) {
while (possible_duplicate < V_NUMPAR) {
if (duplicates(vtocp,
possible_duplicate) == B_TRUE) {
}
}
}
}
return (number_of_partitions);
}
{
int partition_number;
int possible_duplicate;
partition_mask = (u_long)0;
partition_number = 0;
while (partition_number < V_NUMPAR) {
}
}
/*
* Remove duplicates
*/
partition_number = 0;
while (partition_number < V_NUMPAR) {
while (possible_duplicate < V_NUMPAR) {
if (duplicates(vtocp,
possible_duplicate) == B_TRUE) {
}
}
}
}
return (partition_mask);
}
int partition_number)
{
}
{
return (B_TRUE);
} else {
return (B_FALSE);
}
}
/*
* Definitions of private methods
*/
static boolean_t
int partition_1,
int partition_2)
{
return (B_TRUE);
} else {
return (B_FALSE);
}
}