hsfs.c revision 30f5cf21f0e4186919b67ac48223d09ca110f8fe
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License, Version 1.0 only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (the "License"). You may not use this file except in compliance
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Basic file system reading code for standalone I/O system.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Simulates a primitive UNIX I/O system (read(), write(), open(), etc).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Does not support writes.
#ifdef _BOOT
#define SUSP_SP_IX 0
#ifdef _BOOT
extern void kobj_printf(char *, ...);
extern int bootrd_debug;
struct dirstuff {
int loc;
struct hs_direct {
static char *hsfs_sig_tab[] = {
static int bhsfs_unmountroot(void);
static void bhsfs_closeall(void);
static fileid_t *
if (fd >= 0) {
static ino_t
ino_t n;
while (*path) {
path++;
q = path;
path = q;
return ((ino_t)n);
static ino_t
int len;
static struct hs_direct *
int off;
return (NULL);
if (off == 0) {
return (NULL);
return (&hsdep);
if (diff <= 0)
static ssize_t
caddr_t n;
n = buf;
if ((i = count) <= 0)
buf += j;
return (buf - n);
char *bufp;
bhsfs_unmountroot(void)
if (ino == 0) {
bhsfs_closeall(void)
static off_t
switch (whence) {
case SEEK_CUR:
case SEEK_SET:
case SEEK_END:
static uint_t
uint_t i;
uchar_t c;
if (IDE_REGULAR_FILE(c)) {
} else if (IDE_REGULAR_DIR(c)) {
for (i = 0; i < nmlen; i++) {
if (ce_len == 0)
if (ce_lbn) {
ce_len = 0;
ce_lbn = 0;
hsdep);
} while (ce_lbn);
* Return blk number of continuation/SUA, or 0 if no continuation/not a SUA.
static uint_t
char *susp;
uint_t i;
for (i = 0; i < hsfs_num_sig; i++)
case SUSP_CE_IX:
case RRIP_NM_IX:
case HSFS_NUM_SIG:
case SUSP_ST_IX:
return (ce_lbn);
case SUSP_SP_IX:
case RRIP_RR_IX:
return (ce_lbn);