/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* libfstyp module for udfs
*/
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <locale.h>
#include <stdlib.h>
#include <strings.h>
#include <libnvpair.h>
#include <libfstyp_module.h>
#include "ud_lib.h"
typedef struct fstyp_udfs {
int fd;
} fstyp_udfs_t;
static int is_udfs(fstyp_udfs_t *h);
static int get_attr(fstyp_udfs_t *h);
int
{
if (offset != 0) {
return (FSTYP_ERR_OFFSET);
}
return (FSTYP_ERR_NOMEM);
}
free(h);
return (FSTYP_ERR_NOMEM);
}
*handle = (fstyp_mod_handle_t)h;
return (0);
}
void
{
nvlist_free(h->attr);
}
free(h);
}
int
{
return (is_udfs(h));
}
int
{
int error;
return (FSTYP_ERR_NOMEM);
}
nvlist_free(h->attr);
return (error);
}
}
return (0);
}
int
{
int ret;
} else {
}
return (ret);
}
/*
* Assumption is that we will confirm to level-1
*/
int
{
return (ret);
}
return (FSTYP_ERR_NO_MATCH);
}
return (0);
}
/*
* For now, only return generic attributes.
* Will open an RFE to add native attributes.
*/
static int
{
struct vds *v;
int ret = 0;
/* allocate buffer */
}
return (FSTYP_ERR_NOMEM);
}
/* Primary Volume Descriptor */
if (v->pvd_len != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
ret = 0;
out:
return (ret);
}
/* ARGSUSED */
int
{
int32_t i;
int ret = 0;
/*
* All descriptors are 512 bytes
* except lvd, usd and lvid
* findout the largest and allocate space
*/
}
}
}
return (FSTYP_ERR_NOMEM);
}
/*
* Anchor Volume Descriptor
*/
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* Primary Volume Descriptor
*/
if (v->pvd_len != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* Implementation Use descriptor
*/
if (v->iud_len != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* Paritions
*/
if (v->part_len[i] != 0) {
v->part_len[i]) != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
}
/*
* Logical Volume Descriptor
*/
if (v->lvd_len != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* Unallocated Space Descriptor
*/
if (v->usd_len != 0) {
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* Logical Volume Integrity Descriptor
*/
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
/*
* File Set Descriptor
*/
ret = FSTYP_ERR_IO;
goto out;
}
/* LINTED */
}
ret = 0;
out:
return (ret);
}