ufs_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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* UFS partition class implementation file
*/
/*
* System include files
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
/*
* Local include files
*/
#include "medium.h"
#include "partition.h"
/*
* Private attribute and method declarations
*/
#include "partition_private.h"
/*
* Private method declarations
*/
static partition_result_t
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
*/
{
if (partition_result == PARTITION_SUCCESS) {
#ifdef i386
#else
#endif
if ((parent_privatep != NULL) &&
/*
* The partition is a subpartition of a parent
* partition (a slice.) The read_slices() method
* has already assigned the partition a devmap
* index, partition number, and volume name.
* Transfer the volume name to the partition's
* label.
*/
}
} else {
/*
* This is a top level partition, either standalone
* or inside an fdisk table. Set the devmap_index
* to point to the first entry in the volume's devmap,
* which is the entry for the partition that starts at
* the first data block and includes the entire medium.
* Set the partition's top level partition number.
* Preseve the volume name on the partition's label.
*/
}
}
return (partition_result);
}
/*
* Definitions of private methods
*/
static partition_result_t
{
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if ((partition_result == PARTITION_SUCCESS) &&
}
return (partition_result);
}
static partition_result_t
{
struct fs *file_system_structp;
void *super_blockp;
}
if (partition_result == PARTITION_SUCCESS) {
}
}
if (partition_result == PARTITION_SUCCESS) {
}
}
if ((partition_result == PARTITION_SUCCESS) &&
} else {
sizeof (struct fs));
}
if ((partition_result == PARTITION_SUCCESS) &&
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result == PARTITION_SUCCESS) {
}
if (partition_result != PARTITION_SUCCESS) {
}
if (file_system_structp != NULL) {
}
if (super_blockp != NULL) {
}
return (partition_result);
}
static partition_result_t
{
char *key_bufferp;
char *name_bufferp;
}
if (partition_result == PARTITION_SUCCESS) {
sizeof (struct fs));
}
}
if (partition_result == PARTITION_SUCCESS) {
}
}
if (key_bufferp != NULL) {
}
if (name_bufferp != NULL) {
}
return (partition_result);
}