10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*3446Smrj * Common Development and Distribution License (the "License"). 6*3446Smrj * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*3446Smrj * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _SYS_FILEP_H 270Sstevel@tonic-gate #define _SYS_FILEP_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #ifdef __cplusplus 320Sstevel@tonic-gate extern "C" { 330Sstevel@tonic-gate #endif 340Sstevel@tonic-gate 350Sstevel@tonic-gate #include <sys/fs/ufs_fsdir.h> 360Sstevel@tonic-gate #include <sys/fs/ufs_fs.h> 370Sstevel@tonic-gate #include <sys/fs/ufs_inode.h> 380Sstevel@tonic-gate 390Sstevel@tonic-gate /* 400Sstevel@tonic-gate * These structs should be invisible to the caller of 410Sstevel@tonic-gate * the user-level routines 420Sstevel@tonic-gate */ 430Sstevel@tonic-gate typedef struct dev_ident { /* device identifier block */ 440Sstevel@tonic-gate char *di_desc; 450Sstevel@tonic-gate int di_dcookie; 460Sstevel@tonic-gate char di_taken; 470Sstevel@tonic-gate union { 480Sstevel@tonic-gate struct fs di_fs; 490Sstevel@tonic-gate char dummy[SBSIZE]; 500Sstevel@tonic-gate } un_fs; 510Sstevel@tonic-gate } devid_t; 520Sstevel@tonic-gate 53157Sjg /* 54157Sjg * Borrowed bits from i_flag 55157Sjg */ 56157Sjg #define FI_CACHED 0x100000 57157Sjg #define FI_PARTIAL_CACHE 0x200000 58157Sjg #define FI_NOCACHE 0x400000 59157Sjg 60*3446Smrj #define FI_COMPRESSED 0x8 /* File compressed in ramdisk */ 61*3446Smrj #define DECOMP_BUFSIZE (512 * 1024) /* size of decompress buffer */ 62*3446Smrj 630Sstevel@tonic-gate typedef struct file_ident { /* file identifier block */ 640Sstevel@tonic-gate uint_t fi_filedes; 650Sstevel@tonic-gate char *fi_path; 660Sstevel@tonic-gate daddr_t fi_blocknum; 670Sstevel@tonic-gate uint_t fi_count; 680Sstevel@tonic-gate off_t fi_offset; 690Sstevel@tonic-gate caddr_t fi_memp; 700Sstevel@tonic-gate char fi_taken; 71157Sjg char fi_flags; 720Sstevel@tonic-gate devid_t *fi_devp; 730Sstevel@tonic-gate char fi_buf[MAXBSIZE]; 74*3446Smrj int (*fi_getblock)(struct file_ident *); 750Sstevel@tonic-gate struct inode *fi_inode; 760Sstevel@tonic-gate struct file_ident *fi_forw; 770Sstevel@tonic-gate struct file_ident *fi_back; 78*3446Smrj off_t fi_cfoff; /* compressed file offset */ 79*3446Smrj caddr_t fi_dcscrbuf; /* decomp scratch buffer */ 80*3446Smrj size_t fi_dcscrused; /* used bytes in scratch buf */ 81*3446Smrj struct z_stream_s *fi_dcstream; /* decompression stream */ 820Sstevel@tonic-gate } fileid_t; 830Sstevel@tonic-gate 840Sstevel@tonic-gate extern int diskread(fileid_t *); 850Sstevel@tonic-gate 860Sstevel@tonic-gate #ifdef __cplusplus 870Sstevel@tonic-gate } 880Sstevel@tonic-gate #endif 890Sstevel@tonic-gate 900Sstevel@tonic-gate #endif /* _SYS_FILEP_H */ 91