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