blank_partition.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"
/*
* Blank partition class implementation file
*/
/*
* System include files
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
/*
* Private parent class attribute and method declarations
*/
#include "partition_private.h"
#define NO_LABEL_KEY "no_label_key"
#define UNKNOWN_FORMAT "unknown_format"
/*
* Private attribute and method declarations
*/
static partition_result_t
static partition_result_t
/*
* Methods that implement abstract methods
* declared in the parent partition class
*/
static partition_methods_t partition_methods =
/*
* Definition of the public read_partition() method that
* identifies the partition type and sets its attributes
*/
{
int type_index;
if (partition_result == PARTITION_SUCCESS) {
#ifdef i386
#else
#endif
if ((parent_privatep != NULL) &&
/*
* The partition is a subpartition (a slice.)
* The read_slices() method has already
* assigned the partition a volume name,
* partition number, and devmap index. Transfer
* the volume name to the partition's label.
*/
}
} else {
/*
* This a blank top level partition. Assign
* it a top level blank partition number and
* increment the medium's count of top level blank
* partitions. That enables the create_blank_vnodes()
* method to expose the first top level blank
* partition to applications if there are no file
* systems on the medium while concealing any
* other top level blank partitions that may exist.
*/
}
}
return (partition_result);
}
/*
* Definitions of private methods
*/
static partition_result_t
{
if (partition_result == PARTITION_SUCCESS) {
}
}
if (partition_result == PARTITION_SUCCESS) {
}
}
return (partition_result);
}
static partition_result_t
{
if ((medium_privatep->number_of_filesystems == 0) &&
(partition_privatep->partition_number == 0)) {
/*
* There are no file systems or VTOCs on the medium,
* and this is the first or only top level blank
* partition on the medium. Create mountable vnodes
* and a symlink for the partition so application level
* tools can format the medium and create file systems
* on it.
*/
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
/*
* The partition is a subpartition of a mountable
* parent partition. Create slice vnodes for the
* partition so application level tools can create
* file systems on it.
*/
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
}
return (partition_result);
}