hsfs_node.h revision 84b82766376a981b4beff87bdba0efa9e2aa7a39
/*
* 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
*/
/*
* High Sierra filesystem structure definitions
*/
/*
* Copyright 2007 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 */
int hs_num_contig; /* Count of contiguous reads */
int hs_ra_bytes; /* Bytes to readahead */
/* 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).
*/
/*
* We usually use the starting extent LBA for the inode numbers of files and
* directories. As this will not work for zero sized files, we assign a dummy
* inode number to all zero sized files. We use the number 16 as this is the
* LBA for the PVD, this number cannot be a valid starting extent LBA for a
* file. In case that the node number is the HS_DUMMY_INO, we use the LBA and
* offset of the directory entry of this file (which is what we used before
* we started to support correct hard links).
*/
/*
* Hsfs I/O Scheduling parameters and data structures.
* Deadline for reads is set at 5000 usec.
*/
#define HSFS_READ_DEADLINE 5000
#define HSFS_NORMAL 0x0
/*
* This structure holds information for a read request that is enqueued
* for processing by the scheduling function. An AVL tree is used to
* access the read requests in a sorted manner.
*/
struct hio {
};
/*
* This structure holds information about all the read requests issued
* during a read-ahead invocation. This is then enqueued on a task-queue
* for processing by a background thread that takes this read-ahead to
* completion and cleans up.
*/
struct hio_info {
};
/*
* This is per-filesystem structure that stores toplevel data structures for
* the I/O scheduler.
*/
struct hsfs_queue {
/*
* A dummy hio holding the LBN of the last read processed. Easy
* to use in AVL_NEXT for Circular Look behavior.
*/
/*
* A pre-allocated buf for issuing coalesced reads. The scheduling
* function is mostly single threaded by necessity.
*/
/*
* Makes most of the scheduling function Single-threaded.
*/
int max_ra_bytes; /* Max read-ahead quantum */
/* Device Max Transfer size in DEV_BSIZE */
};
/*
* 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 */
/*
* Counters exported through kstats.
*/
};
/*
* 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_ERR_BAD_JOLIET_FILE_LEN 5
#define HSFS_ERR_TRUNC_JOLIET_FILE_LEN 6
#define HSFS_ERR_BAD_DIR_ENTRY 7
#define HSFS_ERR_NEG_SUA_LEN 8
#define HSFS_ERR_BAD_SUA_LEN 9
#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.
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_HSFS_NODE_H */