#define SMOUNTED 12742  /* Magic number to specify mounted filesystem */
#define ROOTINODE 1


typedef struct dinode {
    uint16 i_mode;
    uint16 i_nlink;
    uint16 i_uid;
    uint16 i_gid;
    off_t    i_size;
    time_t   i_atime;
    time_t   i_mtime;
    time_t   i_ctime;
    blkno_t  i_addr[20];
} dinode;		/* Exactly 64 bytes long! */

typedef struct cinode {
    int16    c_magic;		/* Used to check for corruption. */
    int16    c_dev;		/* Inode's device */
    uint16   c_num;		/* Inode # */
    dinode   c_node;
    char     c_refs;		/* In-core reference count */
    char     c_dirty;           /* Modified flag. */
} cinode, *inoptr;

typedef struct filesys {
    int16	s_mounted;
    uint16 	s_isize;
    uint16 	s_fsize;
    int16 	s_nfree;
    blkno_t	s_free[50];
    int16	s_ninode;
    uint16	s_inode[50];
    int16	s_fmod;
    time_t	s_time;
    blkno_t	s_tfree;
    uint16	s_tinode;
    inoptr	s_mntpt; /* Mount point */
} filesys, *fsptr;

typedef struct oft {
    off_t	o_ptr;   /* File position point16er */
    inoptr	o_inode; /* Pointer into in-core inode table */
    char	o_access; /* O_RDONLY, O_WRONLY, or O_RDWR */
    char	o_refs;  /* Reference count: depends on # of active children*/
} oft;
