Subversion Repositories HelenOS

Rev

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

  1. /* Declaration of the basic used types which are part of the V1 and V2 inode
  2.  * as it is on the disk (not in memory).
  3.  */
  4.  
  5.  
  6. #ifndef _TYPE_H
  7. #define _TYPE_H
  8.  
  9. #include <sys/time.h>
  10.  
  11. /* Types used in disk, inode, etc. data structures. */
  12. typedef unsigned short mode_t;     /* file type and permissions bits */
  13. typedef char          nlink_t;     /* number of links to a file */
  14. typedef short          dev_t;      /* holds (major|minor) device pair */
  15. typedef char           gid_t;      /* group id */
  16. typedef unsigned short ino_t;      /* i-node number */
  17. typedef unsigned long  offset_t;   /* offset within a file */
  18. typedef int            pid_t;      /* process id (must be signed) */
  19. typedef short          uid_t;      /* user id */
  20. typedef unsigned long zone_t;      /* zone number */
  21. typedef unsigned short zone1_t;    /* zone number for V1 file systems */
  22. typedef unsigned long block_num_t; /* block number */
  23. typedef unsigned long  bit_t;      /* bit number in a bit map */
  24. typedef unsigned short bitchunk_t; /* collection of bits in a bitmap */
  25.  
  26. typedef unsigned char   u8_t;      /* 8 bit type */
  27. typedef unsigned short u16_t;      /* 16 bit type */
  28. typedef unsigned long  u32_t;      /* 32 bit type */
  29.  
  30. typedef char            i8_t;      /* 8 bit signed type */
  31. typedef short          i16_t;      /* 16 bit signed type */
  32. typedef long           i32_t;      /* 32 bit signed type */
  33.  
  34. //typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
  35.    
  36.    
  37. /* Declaration of the V1 inode as it is on the disk (not in core). */
  38.     typedef struct {                    /* V1.x disk inode */
  39.         mode_t d1_mode;             /* file type, protection, etc. */
  40.         uid_t d1_uid;                   /* user id of the file's owner */
  41.         offset_t d1_size;               /* current file size in bytes */
  42.         time_t d1_mtime;                /* when was file data last changed */
  43.         gid_t d1_gid;                   /* group number */
  44.         nlink_t d1_nlinks;              /* how many links to this file */
  45.         zone1_t d1_zone[V1_NR_TZONES];  /* block nums for direct, ind, and dbl ind */
  46.     } d1_inode_t;
  47.  
  48. /* Declaration of the V2 inode as it is on the disk (not in core). */  
  49.     typedef struct {                    /* V2.x disk inode */
  50.         mode_t d2_mode;             /* file type, protection, etc. */
  51.         u16_t d2_nlinks;                /* how many links to this file. HACK! */
  52.         uid_t d2_uid;                   /* user id of the file's owner. */
  53.         u16_t d2_gid;                   /* group number HACK! */
  54.         offset_t d2_size;               /* current file size in bytes */
  55.         time_t d2_atime;                /* when was file data last accessed */
  56.         time_t d2_mtime;                /* when was file data last changed */
  57.         time_t d2_ctime;                /* when was inode data last changed */
  58.         zone_t d2_zone[V2_NR_TZONES];   /* block nums for direct, ind, and dbl ind */
  59.     } d2_inode_t;
  60.  
  61. #endif /* _TYPE_H */
  62.  
  63.