Subversion Repositories HelenOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*    
  2.      * The s_ninodes field gives the number of inodes available
  3.      * for files and directories, including the root directory.  Inode 0 is
  4.      * on the disk, but not used.  Thus s_ninodes = 4 means that 5 bits will be
  5.      * used in the bit map, bit 0, which is always 1 and not used, and bits 1-4
  6.      * for files and directories.  The disk layout is:
  7.      *
  8.      *      Item        # blocks
  9.      *    boot block      1
  10.      *    super block     1
  11.      *    inode map     s_imap_blocks
  12.      *    zone map      s_zmap_blocks
  13.      *    inodes        (s_ninodes + 'inodes per block' - 1)/'inodes per block'
  14.      *    unused        whatever is needed to fill out the current zone
  15.      *    data zones    (s_zones - s_firstdatazone) << s_log_zone_size
  16.      *
  17. */
  18.    
  19.  
  20. #ifndef _SUPER_H
  21. #define _SUPER_H
  22.  
  23. #define NIL_SUPER (super_block_t *) 0
  24.  
  25. typedef struct {
  26.       ino_t s_ninodes;          /* # usable inodes on the minor device */
  27.       zone1_t  s_nzones;            /* total device size, including bit maps etc */
  28.       short s_imap_blocks;          /* # of blocks used by inode bit map */
  29.       short s_zmap_blocks;          /* # of blocks used by zone bit map */
  30.       zone1_t s_firstdatazone;      /* number of first data zone */
  31.       short s_log_zone_size;        /* log2 of blocks/zone */
  32.       offset_t s_max_size;          /* maximum file size on this device */
  33.       short s_magic;                /* magic number to recognize super-blocks */
  34.       short s_pad;                  /* try to avoid compiler-dependent padding */
  35.       zone_t s_zones;               /* number of zones (replaces s_nzones in V2) */    
  36.    
  37.       /* The following items are only used when the super_block is in memory. */
  38.       unsigned s_inodes_per_block;  /* precalculated from magic number */
  39.       int s_native;         /* set to 1 iff not byte swapped file system */
  40.       int s_version;                /* file system version, zero means bad magic */
  41.       int s_extend;         /* 1 if file system support 30 chars in file name */
  42.       int s_ndzones;                /* # direct zones in an inode */
  43.       int s_nindirs;                /* # indirect zones per indirect block */
  44.       bit_t s_isearch;              /* inodes below this bit number are in use */
  45.       bit_t s_zsearch;              /* all zones below this bit number are in use*/
  46.     } super_block_t;
  47.  
  48. extern super_block_t* super_block;
  49.  
  50. #endif /* _SUPER_H */
  51.