hsfs_node.h 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
*/
/*
* High Sierra filesystem structure definitions
* Copyright 2004 Sun Microsystems, Inc.
* All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_HSFS_NODE_H
#define _SYS_FS_HSFS_NODE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
struct hs_direntry {
char *sym_link; /* path of sym link for readlink() */
};
struct ptable {
};
struct ptable_idx {
};
/*
* hsnode structure:
*
* hs_offset, hs_ptbl_idx, base apply to VDIR type only
*
* nodeid uniquely identifies an hsnode, ISO9660 means
* nodeid can be very big.
* For directories it is the disk address of
* the data extent of the dir (the directory itself,
* ".", and ".." all point to same data extent).
* For non-directories, it is the disk address of the
* directory entry for the file; note that this does
* not permit hard links, as it assumes a single dir
* entry per file.
*/
struct hsnode {
long hs_mapcnt; /* mappings to file pages */
/* except hs_offset */
};
/* hs_flags */
/* hs_modes */
struct hsfid {
};
/*
* All of the fields in the hs_volume are read-only once they have been
* initialized.
*/
struct hs_volume {
};
/*
* The hsnode table is no longer fixed in size but grows
* and shrinks dynamically. However a cache of nodes is still maintained
* for efficiency. This cache size (nhsnode) is a tunable which
* that will fit into the number of bytes defined by HS_HSNODESPACE (below).
*/
/*
* High Sierra filesystem structure.
* There is one of these for each mounted High Sierra filesystem.
*/
enum hs_vol_type {
};
#define HSFS_MAGIC 0x03095500
struct hsfs {
long hsfs_magic; /* should be HSFS_MAGIC */
int hsfs_ptbl_size; /* size of incore path table */
int hsfs_ptbl_idx_size; /* no. of path table index */
char *hsfs_fsmnt; /* name mounted on */
};
/*
* Error types: bit offsets into hsfs_err_flags.
* Also serves as index into hsfs_error[], so must be
* kept in sync with that data structure.
*/
#define HSFS_ERR_TRAILING_JUNK 0
#define HSFS_ERR_LOWER_CASE_NM 1
#define HSFS_ERR_BAD_ROOT_DIR 2
#define HSFS_ERR_UNSUP_TYPE 3
#define HSFS_ERR_BAD_FILE_LEN 4
#define HSFS_HAVE_LOWER_CASE(fsp) \
/*
* File system parameter macros
*/
((OFF) >= \
(HSFS)->hsfs_clsize): \
(HSFS)->hsfs_clsize)
/*
* Conversion macros
*/
/*
* Convert between Logical Block Number and Sector Number.
*/
/*
* Create a nodeid.
* We construct the nodeid from the location of the directory
* entry which points to the file. We divide by 32 to
* compress the range of nodeids; we know that the minimum size
* for an ISO9660 dirent is 34, so we will never have adjacent
* dirents with the same nodeid.
*/
#define HSFS_MIN_DL_SHFT 5
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_HSFS_NODE_H */