Skip to content
Snippets Groups Projects
  • rsc's avatar
    · eaea18cb
    rsc authored
    PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf
    
    Various changes made while offline.
    
     + bwrite sector argument is redundant; use b->sector.
     + reformatting of files for nicer PDF page breaks
     + distinguish between locked, unlocked inodes in type signatures
     + change FD_FILE to FD_INODE
     + move userinit (nee proc0init) to proc.c
     + move ROOTDEV to param.h
     + always parenthesize sizeof argument
    eaea18cb
fsvar.h 470 B
// in-core file system types

struct inode {
  uint dev;           // Device number
  uint inum;          // Inode number
  int ref;            // Reference count
  int flags;           // I_BUSY, I_VALID

  short type;         // copy of disk inode
  short major;
  short minor;
  short nlink;
  uint size;
  uint addrs[NADDRS];
};

// unlocked inode - only dev and inum are available
struct uinode {
  uint dev;
  uint inum;
};

#define I_BUSY 0x1
#define I_VALID 0x2