source: trunk/minix/servers/fs/const.h@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 5.1 KB
Line 
1/* Tables sizes */
2#define V1_NR_DZONES 7 /* # direct zone numbers in a V1 inode */
3#define V1_NR_TZONES 9 /* total # zone numbers in a V1 inode */
4#define V2_NR_DZONES 7 /* # direct zone numbers in a V2 inode */
5#define V2_NR_TZONES 10 /* total # zone numbers in a V2 inode */
6
7#define NR_FILPS 256 /* # slots in filp table */
8#define NR_INODES 256 /* # slots in "in core" inode table */
9#define NR_SUPERS 12 /* # slots in super block table */
10#define NR_LOCKS 8 /* # slots in the file locking table */
11
12/* The type of sizeof may be (unsigned) long. Use the following macro for
13 * taking the sizes of small objects so that there are no surprises like
14 * (small) long constants being passed to routines expecting an int.
15 */
16#define usizeof(t) ((unsigned) sizeof(t))
17
18/* File system types. */
19#define SUPER_MAGIC 0x137F /* magic number contained in super-block */
20#define SUPER_REV 0x7F13 /* magic # when 68000 disk read on PC or vv */
21#define SUPER_V2 0x2468 /* magic # for V2 file systems */
22#define SUPER_V2_REV 0x6824 /* V2 magic written on PC, read on 68K or vv */
23#define SUPER_V3 0x4d5a /* magic # for V3 file systems */
24
25#define V1 1 /* version number of V1 file systems */
26#define V2 2 /* version number of V2 file systems */
27#define V3 3 /* version number of V3 file systems */
28
29/* Miscellaneous constants */
30#define SU_UID ((uid_t) 0) /* super_user's uid_t */
31#define SERVERS_UID ((uid_t) 11) /* who may do FSSIGNON */
32#define SYS_UID ((uid_t) 0) /* uid_t for processes MM and INIT */
33#define SYS_GID ((gid_t) 0) /* gid_t for processes MM and INIT */
34#define NORMAL 0 /* forces get_block to do disk read */
35#define NO_READ 1 /* prevents get_block from doing disk read */
36#define PREFETCH 2 /* tells get_block not to read or mark dev */
37
38#define XPIPE (-NR_TASKS-1) /* used in fp_task when susp'd on pipe */
39#define XLOCK (-NR_TASKS-2) /* used in fp_task when susp'd on lock */
40#define XPOPEN (-NR_TASKS-3) /* used in fp_task when susp'd on pipe open */
41#define XSELECT (-NR_TASKS-4) /* used in fp_task when susp'd on select */
42
43#define NO_BIT ((bit_t) 0) /* returned by alloc_bit() to signal failure */
44
45#define DUP_MASK 0100 /* mask to distinguish dup2 from dup */
46
47#define LOOK_UP 0 /* tells search_dir to lookup string */
48#define ENTER 1 /* tells search_dir to make dir entry */
49#define DELETE 2 /* tells search_dir to delete entry */
50#define IS_EMPTY 3 /* tells search_dir to ret. OK or ENOTEMPTY */
51
52/* write_map() args */
53#define WMAP_FREE (1 << 0)
54
55#define PATH_TRANSPARENT 000 /* parse_path stops at final object */
56#define PATH_PENULTIMATE 001 /* parse_path stops at last but one name */
57#define PATH_OPAQUE 002 /* parse_path stops at final name */
58#define PATH_NONSYMBOLIC 004 /* parse_path scans final name if symbolic */
59#define PATH_STRIPDOT 010 /* parse_path strips /. from path */
60#define EAT_PATH PATH_TRANSPARENT
61#define EAT_PATH_OPAQUE PATH_OPAQUE
62#define LAST_DIR PATH_PENULTIMATE
63#define LAST_DIR_NOTDOT PATH_PENULTIMATE | PATH_STRIPDOT
64#define LAST_DIR_EATSYM PATH_NONSYMBOLIC
65#define SYMLOOP 16
66
67#define CLEAN 0 /* disk and memory copies identical */
68#define DIRTY 1 /* disk and memory copies differ */
69#define ATIME 002 /* set if atime field needs updating */
70#define CTIME 004 /* set if ctime field needs updating */
71#define MTIME 010 /* set if mtime field needs updating */
72
73#define BYTE_SWAP 0 /* tells conv2/conv4 to swap bytes */
74
75#define END_OF_FILE (-104) /* eof detected */
76
77#define ROOT_INODE 1 /* inode number for root directory */
78#define BOOT_BLOCK ((block_t) 0) /* block number of boot block */
79#define SUPER_BLOCK_BYTES (1024) /* bytes offset */
80#define START_BLOCK 2 /* first block of FS (not counting SB) */
81
82#define DIR_ENTRY_SIZE usizeof (struct direct) /* # bytes/dir entry */
83#define NR_DIR_ENTRIES(b) ((b)/DIR_ENTRY_SIZE) /* # dir entries/blk */
84#define SUPER_SIZE usizeof (struct super_block) /* super_block size */
85#define PIPE_SIZE(b) (V1_NR_DZONES*(b)) /* pipe size in bytes */
86
87#define FS_BITMAP_CHUNKS(b) ((b)/usizeof (bitchunk_t))/* # map chunks/blk */
88#define FS_BITCHUNK_BITS (usizeof(bitchunk_t) * CHAR_BIT)
89#define FS_BITS_PER_BLOCK(b) (FS_BITMAP_CHUNKS(b) * FS_BITCHUNK_BITS)
90
91/* Derived sizes pertaining to the V1 file system. */
92#define V1_ZONE_NUM_SIZE usizeof (zone1_t) /* # bytes in V1 zone */
93#define V1_INODE_SIZE usizeof (d1_inode) /* bytes in V1 dsk ino */
94
95/* # zones/indir block */
96#define V1_INDIRECTS (_STATIC_BLOCK_SIZE/V1_ZONE_NUM_SIZE)
97
98/* # V1 dsk inodes/blk */
99#define V1_INODES_PER_BLOCK (_STATIC_BLOCK_SIZE/V1_INODE_SIZE)
100
101/* Derived sizes pertaining to the V2 file system. */
102#define V2_ZONE_NUM_SIZE usizeof (zone_t) /* # bytes in V2 zone */
103#define V2_INODE_SIZE usizeof (d2_inode) /* bytes in V2 dsk ino */
104#define V2_INDIRECTS(b) ((b)/V2_ZONE_NUM_SIZE) /* # zones/indir block */
105#define V2_INODES_PER_BLOCK(b) ((b)/V2_INODE_SIZE)/* # V2 dsk inodes/blk */
Note: See TracBrowser for help on using the repository browser.