Rev 2385 | 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 | */ |
||
35 | |||
36 | |||
2385 | konopa | 37 | /* Declaration of the basic used types which are part of the V1 and V2 inode |
38 | * as it is on the disk (not in memory). |
||
39 | */ |
||
40 | |||
41 | |||
42 | #ifndef _TYPE_H |
||
43 | #define _TYPE_H |
||
44 | |||
45 | #include <sys/time.h> |
||
46 | |||
47 | /* Types used in disk, inode, etc. data structures. */ |
||
48 | typedef unsigned short mode_t; /* file type and permissions bits */ |
||
49 | typedef char nlink_t; /* number of links to a file */ |
||
50 | typedef short dev_t; /* holds (major|minor) device pair */ |
||
51 | typedef char gid_t; /* group id */ |
||
52 | typedef unsigned short ino_t; /* i-node number */ |
||
53 | typedef unsigned long offset_t; /* offset within a file */ |
||
54 | typedef int pid_t; /* process id (must be signed) */ |
||
55 | typedef short uid_t; /* user id */ |
||
56 | typedef unsigned long zone_t; /* zone number */ |
||
57 | typedef unsigned short zone1_t; /* zone number for V1 file systems */ |
||
58 | typedef unsigned long block_num_t; /* block number */ |
||
59 | typedef unsigned long bit_t; /* bit number in a bit map */ |
||
60 | typedef unsigned short bitchunk_t; /* collection of bits in a bitmap */ |
||
61 | |||
62 | typedef unsigned char u8_t; /* 8 bit type */ |
||
63 | typedef unsigned short u16_t; /* 16 bit type */ |
||
64 | typedef unsigned long u32_t; /* 32 bit type */ |
||
65 | |||
66 | typedef char i8_t; /* 8 bit signed type */ |
||
67 | typedef short i16_t; /* 16 bit signed type */ |
||
68 | typedef long i32_t; /* 32 bit signed type */ |
||
69 | |||
70 | //typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */ |
||
71 | |||
72 | |||
73 | /* Declaration of the V1 inode as it is on the disk (not in core). */ |
||
74 | typedef struct { /* V1.x disk inode */ |
||
75 | mode_t d1_mode; /* file type, protection, etc. */ |
||
76 | uid_t d1_uid; /* user id of the file's owner */ |
||
77 | offset_t d1_size; /* current file size in bytes */ |
||
78 | time_t d1_mtime; /* when was file data last changed */ |
||
79 | gid_t d1_gid; /* group number */ |
||
80 | nlink_t d1_nlinks; /* how many links to this file */ |
||
81 | zone1_t d1_zone[V1_NR_TZONES]; /* block nums for direct, ind, and dbl ind */ |
||
82 | } d1_inode_t; |
||
83 | |||
84 | /* Declaration of the V2 inode as it is on the disk (not in core). */ |
||
85 | typedef struct { /* V2.x disk inode */ |
||
86 | mode_t d2_mode; /* file type, protection, etc. */ |
||
87 | u16_t d2_nlinks; /* how many links to this file. HACK! */ |
||
88 | uid_t d2_uid; /* user id of the file's owner. */ |
||
89 | u16_t d2_gid; /* group number HACK! */ |
||
90 | offset_t d2_size; /* current file size in bytes */ |
||
91 | time_t d2_atime; /* when was file data last accessed */ |
||
92 | time_t d2_mtime; /* when was file data last changed */ |
||
93 | time_t d2_ctime; /* when was inode data last changed */ |
||
94 | zone_t d2_zone[V2_NR_TZONES]; /* block nums for direct, ind, and dbl ind */ |
||
95 | } d2_inode_t; |
||
96 | |||
97 | #endif /* _TYPE_H */ |
||
98 |