/*
* Copyright (c) 1987,1997, Prentice Hall
* All rights reserved.
*
* Redistribution and use of the MINIX operating system in source and
* binary forms, with or without modification, are permitted provided
* that the following conditions are met:
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* - Neither the name of Prentice Hall nor the names of the software
* authors or contributors may be used to endorse or promote
* products derived from this software without specific prior
* written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/** @addtogroup FileSystemImpl
* @{
*/
/**
* @file type.h
* @brief Declaration of the basic used types which are part of the V1 and V2 inode
* as it is on the disk (not in memory).
*/
#ifndef _TYPE_H
#define _TYPE_H
#include <sys/time.h>
/* Types used in disk, inode, etc. data structures. */
typedef unsigned short mode_t; /**< file type and permissions bits */
typedef char nlink_t; /**< number of links to a file */
typedef short dev_t; /**< holds (major|minor) device pair */
typedef char gid_t; /**< group id */
typedef unsigned short ino_t; /**< i-node number */
typedef unsigned long offset_t; /**< offset within a file */
typedef int pid_t; /**< process id (must be signed) */
typedef short uid_t; /**< user id */
typedef unsigned long zone_t; /**< zone number */
typedef unsigned short zone1_t; /**< zone number for V1 file systems */
typedef unsigned long block_num_t; /**< block number */
typedef unsigned long bit_t; /**< bit number in a bit map */
typedef unsigned short bitchunk_t; /**< collection of bits in a bitmap */
typedef unsigned char u8_t; /**< 8 bit type */
typedef unsigned short u16_t; /**< 16 bit type */
typedef unsigned long u32_t; /**< 32 bit type */
typedef char i8_t; /**< 8 bit signed type */
typedef short i16_t; /**< 16 bit signed type */
typedef long i32_t; /**< 32 bit signed type */
//typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
/**
* Declaration of the V1 inode as it is on the disk (not in core).
*/
typedef struct { /**< V1.x disk inode */
mode_t d1_mode; /**< file type, protection, etc. */
uid_t d1_uid; /**< user id of the file's owner */
offset_t d1_size; /**< current file size in bytes */
time_t d1_mtime; /**< when was file data last changed */
gid_t d1_gid; /**< group number */
nlink_t d1_nlinks; /**< how many links to this file */
zone1_t d1_zone[V1_NR_TZONES]; /**< block nums for direct, ind, and dbl ind */
} d1_inode_t;
/**
* Declaration of the V2 inode as it is on the disk (not in core).
*/
typedef struct { /**< V2.x disk inode */
mode_t d2_mode; /**< file type, protection, etc. */
u16_t d2_nlinks; /**< how many links to this file. HACK! */
uid_t d2_uid; /**< user id of the file's owner. */
u16_t d2_gid; /**< group number HACK! */
offset_t d2_size; /**< current file size in bytes */
time_t d2_atime; /**< when was file data last accessed */
time_t d2_mtime; /**< when was file data last changed */
time_t d2_ctime; /**< when was inode data last changed */
zone_t d2_zone[V2_NR_TZONES]; /**< block nums for direct, ind, and dbl ind */
} d2_inode_t;
#endif /* _TYPE_H */
/**
* }
*/