Rev 2404 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2404 | Rev 2435 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 1987,1997, Prentice Hall |
2 | * Copyright (c) 1987,1997, Prentice Hall |
3 | * All rights reserved. |
3 | * All rights reserved. |
4 | * |
4 | * |
5 | * Redistribution and use of the MINIX operating system in source and |
5 | * Redistribution and use of the MINIX operating system in source and |
6 | * binary forms, with or without modification, are permitted provided |
6 | * binary forms, with or without modification, are permitted provided |
7 | * that the following conditions are met: |
7 | * that the following conditions are met: |
8 | 8 | ||
9 | * - Redistributions of source code must retain the above copyright |
9 | * - Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. |
10 | * notice, this list of conditions and the following disclaimer. |
11 | 11 | ||
12 | * - Redistributions in binary form must reproduce the above |
12 | * - Redistributions in binary form must reproduce the above |
13 | * copyright notice, this list of conditions and the following |
13 | * copyright notice, this list of conditions and the following |
14 | * disclaimer in the documentation and/or other materials provided |
14 | * disclaimer in the documentation and/or other materials provided |
15 | * with the distribution. |
15 | * with the distribution. |
16 | 16 | ||
17 | * - Neither the name of Prentice Hall nor the names of the software |
17 | * - Neither the name of Prentice Hall nor the names of the software |
18 | * authors or contributors may be used to endorse or promote |
18 | * authors or contributors may be used to endorse or promote |
19 | * products derived from this software without specific prior |
19 | * products derived from this software without specific prior |
20 | * written permission. |
20 | * written permission. |
21 | 21 | ||
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND |
23 | * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
23 | * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
24 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
24 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
25 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
26 | * IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
26 | * IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE |
27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
30 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
30 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
31 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
31 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE |
32 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
32 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
33 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ |
34 | */ |
- | 35 | ||
- | 36 | /** @addtogroup FileSystemImpl |
|
- | 37 | * @{ |
|
- | 38 | */ |
|
35 | 39 | ||
- | 40 | /** |
|
- | 41 | * @file block.h |
|
36 | /* Data block. */ |
42 | * @brief Data block. |
- | 43 | */ |
|
37 | 44 | ||
38 | #ifndef _BLOCK_H |
45 | #ifndef _BLOCK_H |
39 | #define _BLOCK_H |
46 | #define _BLOCK_H |
40 | 47 | ||
41 | #include "dir.h" |
48 | #include "dir.h" |
42 | 49 | ||
43 | #define DIRECTORY_BLOCK 1 /* directory block */ |
50 | #define DIRECTORY_BLOCK 1 /**< directory block */ |
44 | #define INDIRECT_BLOCK 2 /* pointer block */ |
51 | #define INDIRECT_BLOCK 2 /**< pointer block */ |
45 | 52 | ||
- | 53 | /** |
|
- | 54 | * Data block |
|
- | 55 | */ |
|
46 | typedef struct { |
56 | typedef struct { |
47 | union { |
57 | union { |
48 | char b__data[BLOCK_SIZE]; /* ordinary user data */ |
58 | char b__data[BLOCK_SIZE]; /**< ordinary user data */ |
49 | direct_t b__dir[NR_DIR_ENTRIES]; /* directory block */ |
59 | direct_t b__dir[NR_DIR_ENTRIES]; /**< directory block */ |
50 | directex_t b__direx[NR_DIR_ENTRIES_EX]; /* extended directory block */ |
60 | directex_t b__direx[NR_DIR_ENTRIES_EX]; /**< extended directory block */ |
51 | zone1_t b__v1_ind[V1_INDIRECTS]; /* V1 indirect block */ |
61 | zone1_t b__v1_ind[V1_INDIRECTS]; /**< V1 indirect block */ |
52 | zone_t b__v2_ind[V2_INDIRECTS]; /* V2 indirect block */ |
62 | zone_t b__v2_ind[V2_INDIRECTS]; /**< V2 indirect block */ |
53 | d1_inode_t b__v1_ino[V1_INODES_PER_BLOCK]; /* V1 inode block */ |
63 | d1_inode_t b__v1_ino[V1_INODES_PER_BLOCK]; /**< V1 inode block */ |
54 | d2_inode_t b__v2_ino[V2_INODES_PER_BLOCK]; /* V2 inode block */ |
64 | d2_inode_t b__v2_ino[V2_INODES_PER_BLOCK]; /**< V2 inode block */ |
55 | } b; |
65 | } b; |
56 | 66 | ||
57 | block_num_t b_blocknr; /* number of block */ |
67 | block_num_t b_blocknr; /**< number of block */ |
58 | char b_count; /* number of users of this block */ |
68 | char b_count; /**< number of users of this block */ |
59 | } block_t; |
69 | } block_t; |
60 | 70 | ||
61 | extern block_t* work_block; |
71 | extern block_t* work_block; |
62 | 72 | ||
63 | #endif /* _BLOCK_H */ |
73 | #endif /* _BLOCK_H */ |
- | 74 | ||
- | 75 | /** |
|
- | 76 | * } |
|
- | 77 | */ |
|
- | 78 | ||
64 | 79 |