📄 const.h
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/fs/const.h
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19500 /* Tables sizes */
19501 #define V1_NR_DZONES 7 /* # direct zone numbers in a V1 inode */
19502 #define V1_NR_TZONES 9 /* total # zone numbers in a V1 inode */
19503 #define V2_NR_DZONES 7 /* # direct zone numbers in a V2 inode */
19504 #define V2_NR_TZONES 10 /* total # zone numbers in a V2 inode */
19505
19506 #define NR_FILPS 128 /* # slots in filp table */
19507 #define NR_INODES 64 /* # slots in "in core" inode table */
19508 #define NR_SUPERS 8 /* # slots in super block table */
19509 #define NR_LOCKS 8 /* # slots in the file locking table */
19510
19511 /* The type of sizeof may be (unsigned) long. Use the following macro for
19512 * taking the sizes of small objects so that there are no surprises like
19513 * (small) long constants being passed to routines expecting an int.
19514 */
19515 #define usizeof(t) ((unsigned) sizeof(t))
19516
19517 /* File system types. */
19518 #define SUPER_MAGIC 0x137F /* magic number contained in super-block */
19519 #define SUPER_REV 0x7F13 /* magic # when 68000 disk read on PC or vv */
19520 #define SUPER_V2 0x2468 /* magic # for V2 file systems */
19521 #define SUPER_V2_REV 0x6824 /* V2 magic written on PC, read on 68K or vv */
19522
19523 #define V1 1 /* version number of V1 file systems */
19524 #define V2 2 /* version number of V2 file systems */
19525
19526 /* Miscellaneous constants */
19527 #define SU_UID ((uid_t) 0) /* super_user's uid_t */
19528 #define SYS_UID ((uid_t) 0) /* uid_t for processes MM and INIT */
19529 #define SYS_GID ((gid_t) 0) /* gid_t for processes MM and INIT */
19530 #define NORMAL 0 /* forces get_block to do disk read */
19531 #define NO_READ 1 /* prevents get_block from doing disk read */
19532 #define PREFETCH 2 /* tells get_block not to read or mark dev */
19533
19534 #define XPIPE (-NR_TASKS-1) /* used in fp_task when susp'd on pipe */
19535 #define XOPEN (-NR_TASKS-2) /* used in fp_task when susp'd on open */
19536 #define XLOCK (-NR_TASKS-3) /* used in fp_task when susp'd on lock */
19537 #define XPOPEN (-NR_TASKS-4) /* used in fp_task when susp'd on pipe open */
19538
19539 #define NO_BIT ((bit_t) 0) /* returned by alloc_bit() to signal failure */
19540
19541 #define DUP_MASK 0100 /* mask to distinguish dup2 from dup */
19542
19543 #define LOOK_UP 0 /* tells search_dir to lookup string */
19544 #define ENTER 1 /* tells search_dir to make dir entry */
19545 #define DELETE 2 /* tells search_dir to delete entry */
19546 #define IS_EMPTY 3 /* tells search_dir to ret. OK or ENOTEMPTY */
19547
19548 #define CLEAN 0 /* disk and memory copies identical */
19549 #define DIRTY 1 /* disk and memory copies differ */
19550 #define ATIME 002 /* set if atime field needs updating */
19551 #define CTIME 004 /* set if ctime field needs updating */
19552 #define MTIME 010 /* set if mtime field needs updating */
19553
19554 #define BYTE_SWAP 0 /* tells conv2/conv4 to swap bytes */
19555 #define DONT_SWAP 1 /* tells conv2/conv4 not to swap bytes */
19556
19557 #define END_OF_FILE (-104) /* eof detected */
19558
19559 #define ROOT_INODE 1 /* inode number for root directory */
19560 #define BOOT_BLOCK ((block_t) 0) /* block number of boot block */
19561 #define SUPER_BLOCK ((block_t) 1) /* block number of super block */
19562
19563 #define DIR_ENTRY_SIZE usizeof (struct direct) /* # bytes/dir entry */
19564 #define NR_DIR_ENTRIES (BLOCK_SIZE/DIR_ENTRY_SIZE) /* # dir entries/blk */
19565 #define SUPER_SIZE usizeof (struct super_block) /* super_block size */
19566 #define PIPE_SIZE (V1_NR_DZONES*BLOCK_SIZE) /* pipe size in bytes */
19567 #define BITMAP_CHUNKS (BLOCK_SIZE/usizeof (bitchunk_t))/* # map chunks/blk */
19568
19569 /* Derived sizes pertaining to the V1 file system. */
19570 #define V1_ZONE_NUM_SIZE usizeof (zone1_t) /* # bytes in V1 zone */
19571 #define V1_INODE_SIZE usizeof (d1_inode) /* bytes in V1 dsk ino */
19572 #define V1_INDIRECTS (BLOCK_SIZE/V1_ZONE_NUM_SIZE) /* # zones/indir block */
19573 #define V1_INODES_PER_BLOCK (BLOCK_SIZE/V1_INODE_SIZE)/* # V1 dsk inodes/blk */
19574
19575 /* Derived sizes pertaining to the V2 file system. */
19576 #define V2_ZONE_NUM_SIZE usizeof (zone_t) /* # bytes in V2 zone */
19577 #define V2_INODE_SIZE usizeof (d2_inode) /* bytes in V2 dsk ino */
19578 #define V2_INDIRECTS (BLOCK_SIZE/V2_ZONE_NUM_SIZE) /* # zones/indir block */
19579 #define V2_INODES_PER_BLOCK (BLOCK_SIZE/V2_INODE_SIZE)/* # V2 dsk inodes/blk */
19580
19581 #define printf printk
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -