home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / filesy~1 / mfsdefrg.zoo / minix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-15  |  1.7 KB  |  66 lines

  1. /*
  2.  * minix.h - minix-specific include file for the Linux file system 
  3.  * degragmenter. 
  4.  * minix.h,v 1.1 1992/12/23 03:43:23 linux Exp
  5.  *
  6.  * Copyright (C) 1992 Stephen Tweedie (sct@dcs.ed.ac.uk)
  7.  *
  8.  * Copyright (C) 1992 Remy Card (card@masi.ibp.fr)
  9.  *
  10.  * Copyright (C) 1991 Linus Torvalds (torvalds@kruuna.helsinki.fi)
  11.  * 
  12.  * This file may be redistributed under the terms of the GNU General
  13.  * Public License.
  14.  *
  15.  */
  16.  
  17. #include <minix_fs.h>
  18.  
  19. #define NAME_LEN MINIX_NAME_LEN
  20.  
  21. #define ROOT_INO 1
  22. #define FIRST_USER_INODE 2
  23. #define DIRECT_ZONES 7
  24.  
  25. #ifdef MINIX_V2
  26. typedef long Block;
  27. #define d_inode new_minix_inode
  28. #else
  29.  
  30. typedef unsigned short Block;
  31.  
  32. #define d_inode minix_inode
  33.  
  34. #endif 
  35.  
  36. #define UPPER(size,n)        ((size + ((n) - 1)) / (n))
  37. #define INODE_SIZE        (sizeof (struct d_inode))
  38. #define INODE_BLOCKS        UPPER(INODES, MINIX_INODES_PER_BLOCK)
  39. #define INODE_BUFFER_SIZE    (INODE_BLOCKS * BLOCK_SIZE)
  40.  
  41. #define BITS_PER_BLOCK        (BLOCK_SIZE<<3)
  42.  
  43. #define Super        (* (struct minix_super_block *) super_block_buffer)
  44. #define INODES ((unsigned long)Super.s_ninodes)
  45. #ifdef MINIX_V2
  46. #define ZONES Super.s_zones
  47. #else
  48. #define ZONES ((unsigned long)Super.s_nzones)
  49. #endif
  50. #define IMAPS ((unsigned long)Super.s_imap_blocks)
  51. #define ZMAPS ((unsigned long)Super.s_zmap_blocks)
  52. #define FIRSTZONE ((unsigned long)Super.s_firstdatazone)
  53. #define ZONESIZE ((unsigned long)Super.s_log_zone_size)
  54. #define MAXSIZE ((unsigned long)Super.s_max_size)
  55. #define MAGIC (Super.s_magic)
  56. #define NORM_FIRSTZONE (2+IMAPS+ZMAPS+INODE_BLOCKS)
  57. #ifdef MINIX_V2
  58. #define INODES_PER_BLOCK (BLOCK_SIZE >> 2)
  59. #undef MINIX_SUPER_MAGIC
  60. #undef MINIX_INODES_PER_BLOCK
  61. #define MINIX_SUPER_MAGIC NEW_MINIX_SUPER_MAGIC
  62. #define MINIX_INODES_PER_BLOCK NEW_MINIX_INODES_PER_BLOCK
  63. #else
  64. #define INODES_PER_BLOCK (BLOCK_SIZE >> 1)
  65. #endif
  66.