Rev 2382 | 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 | |||
2382 | konopa | 37 | /* |
38 | * The s_ninodes field gives the number of inodes available |
||
39 | * for files and directories, including the root directory. Inode 0 is |
||
40 | * on the disk, but not used. Thus s_ninodes = 4 means that 5 bits will be |
||
41 | * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4 |
||
42 | * for files and directories. The disk layout is: |
||
43 | * |
||
44 | * Item # blocks |
||
45 | * boot block 1 |
||
46 | * super block 1 |
||
47 | * inode map s_imap_blocks |
||
48 | * zone map s_zmap_blocks |
||
49 | * inodes (s_ninodes + 'inodes per block' - 1)/'inodes per block' |
||
50 | * unused whatever is needed to fill out the current zone |
||
51 | * data zones (s_zones - s_firstdatazone) << s_log_zone_size |
||
52 | * |
||
53 | */ |
||
54 | |||
55 | |||
56 | #ifndef _SUPER_H |
||
57 | #define _SUPER_H |
||
58 | |||
59 | #define NIL_SUPER (super_block_t *) 0 |
||
60 | |||
61 | typedef struct { |
||
62 | ino_t s_ninodes; /* # usable inodes on the minor device */ |
||
63 | zone1_t s_nzones; /* total device size, including bit maps etc */ |
||
64 | short s_imap_blocks; /* # of blocks used by inode bit map */ |
||
65 | short s_zmap_blocks; /* # of blocks used by zone bit map */ |
||
66 | zone1_t s_firstdatazone; /* number of first data zone */ |
||
67 | short s_log_zone_size; /* log2 of blocks/zone */ |
||
68 | offset_t s_max_size; /* maximum file size on this device */ |
||
69 | short s_magic; /* magic number to recognize super-blocks */ |
||
70 | short s_pad; /* try to avoid compiler-dependent padding */ |
||
71 | zone_t s_zones; /* number of zones (replaces s_nzones in V2) */ |
||
72 | |||
73 | /* The following items are only used when the super_block is in memory. */ |
||
74 | unsigned s_inodes_per_block; /* precalculated from magic number */ |
||
75 | int s_native; /* set to 1 iff not byte swapped file system */ |
||
76 | int s_version; /* file system version, zero means bad magic */ |
||
77 | int s_extend; /* 1 if file system support 30 chars in file name */ |
||
78 | int s_ndzones; /* # direct zones in an inode */ |
||
79 | int s_nindirs; /* # indirect zones per indirect block */ |
||
80 | bit_t s_isearch; /* inodes below this bit number are in use */ |
||
81 | bit_t s_zsearch; /* all zones below this bit number are in use*/ |
||
82 | } super_block_t; |
||
83 | |||
84 | extern super_block_t* super_block; |
||
85 | |||
86 | #endif /* _SUPER_H */ |