Subversion Repositories HelenOS

Rev

Rev 2404 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2404 konopa 1
/*
2
 * Copyright (c) 1987,1997, Prentice Hall
3
 * All rights reserved.
4
 *
5
 * Redistribution and use of the MINIX operating system in source and
6
 * binary forms, with or without modification, are permitted provided
7
 * that the following conditions are met:
8
 
9
 * - Redistributions of source code must retain the above copyright
10
 *   notice, this list of conditions and the following disclaimer.
11
 
12
 * - Redistributions in binary form must reproduce the above
13
 *   copyright notice, this list of conditions and the following
14
 *   disclaimer in the documentation and/or other materials provided
15
 *   with the distribution.
16
 
17
 * - Neither the name of Prentice Hall nor the names of the software
18
 *   authors or contributors may be used to endorse or promote
19
 *   products derived from this software without specific prior
20
 *   written permission.
21
 
22
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
23
 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26
 * IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE
27
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
 */
2435 jelen 35
 
36
/** @addtogroup FileSystemImpl
37
* @{
38
*/
2404 konopa 39
 
2435 jelen 40
/**
41
 * @file    type.h
42
 * @brief   Declaration of the basic used types which are part of the V1 and V2 inode
43
 *        as it is on the disk (not in memory).
2385 konopa 44
 */
45
 
46
 
47
#ifndef _TYPE_H
48
#define _TYPE_H
49
 
50
#include <sys/time.h>
51
 
52
/* Types used in disk, inode, etc. data structures. */
2435 jelen 53
typedef unsigned short mode_t;     /**< file type and permissions bits */
54
typedef char          nlink_t;     /**< number of links to a file */
55
typedef short          dev_t;      /**< holds (major|minor) device pair */
56
typedef char           gid_t;      /**< group id */
57
typedef unsigned short ino_t;      /**< i-node number */
58
typedef unsigned long  offset_t;   /**< offset within a file */
59
typedef int            pid_t;      /**< process id (must be signed) */
60
typedef short          uid_t;      /**< user id */
61
typedef unsigned long zone_t;      /**< zone number */
62
typedef unsigned short zone1_t;    /**< zone number for V1 file systems */
63
typedef unsigned long block_num_t; /**< block number */
64
typedef unsigned long  bit_t;      /**< bit number in a bit map */
65
typedef unsigned short bitchunk_t; /**< collection of bits in a bitmap */
2385 konopa 66
 
2435 jelen 67
typedef unsigned char   u8_t;      /**< 8 bit type */
68
typedef unsigned short u16_t;      /**< 16 bit type */
69
typedef unsigned long  u32_t;      /**< 32 bit type */
2385 konopa 70
 
2435 jelen 71
typedef char            i8_t;      /**< 8 bit signed type */
72
typedef short          i16_t;      /**< 16 bit signed type */
73
typedef long           i32_t;      /**< 32 bit signed type */
2385 konopa 74
 
75
//typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
76
 
77
 
2435 jelen 78
/**
79
 * Declaration of the V1 inode as it is on the disk (not in core).
80
 */
81
    typedef struct {                    /**< V1.x disk inode */
82
        mode_t d1_mode;             /**< file type, protection, etc. */
83
        uid_t d1_uid;                   /**< user id of the file's owner */
84
        offset_t d1_size;               /**< current file size in bytes */
85
        time_t d1_mtime;                /**< when was file data last changed */
86
        gid_t d1_gid;                   /**< group number */
87
        nlink_t d1_nlinks;              /**< how many links to this file */
88
        zone1_t d1_zone[V1_NR_TZONES];  /**< block nums for direct, ind, and dbl ind */
2385 konopa 89
    } d1_inode_t;
90
 
2435 jelen 91
/**
92
 * Declaration of the V2 inode as it is on the disk (not in core).
93
 */
94
    typedef struct {                    /**< V2.x disk inode */
95
        mode_t d2_mode;             /**< file type, protection, etc. */
96
        u16_t d2_nlinks;                /**< how many links to this file. HACK! */
97
        uid_t d2_uid;                   /**< user id of the file's owner. */
98
        u16_t d2_gid;                   /**< group number HACK! */
99
        offset_t d2_size;               /**< current file size in bytes */
100
        time_t d2_atime;                /**< when was file data last accessed */
101
        time_t d2_mtime;                /**< when was file data last changed */
102
        time_t d2_ctime;                /**< when was inode data last changed */
103
        zone_t d2_zone[V2_NR_TZONES];   /**< block nums for direct, ind, and dbl ind */
2385 konopa 104
    } d2_inode_t;
105
 
106
#endif /* _TYPE_H */
107
 
2435 jelen 108
 
109
/**
110
 * }
111
 */
112