root/file.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


   1 struct file {
   2   enum { FD_NONE, FD_PIPE, FD_INODE } type;
   3   int ref; // reference count
   4   char readable;
   5   char writable;
   6   struct pipe *pipe;
   7   struct inode *ip;
   8   uint off;
   9 };
  10 
  11 
  12 // in-memory copy of an inode
  13 struct inode {
  14   uint dev;           // Device number
  15   uint inum;          // Inode number
  16   int ref;            // Reference count
  17   struct sleeplock lock; // protects everything below here
  18   int valid;          // inode has been read from disk?
  19 
  20   short type;         // copy of disk inode
  21   short major;
  22   short minor;
  23   short nlink;
  24   uint size;
  25   uint addrs[NDIRECT+1];
  26 };
  27 
  28 // table mapping major device number to
  29 // device functions
  30 struct devsw {
  31   int (*read)(struct inode*, char*, int);
  32   int (*write)(struct inode*, char*, int);
  33 };
  34 
  35 extern struct devsw devsw[];
  36 
  37 #define CONSOLE 1

/* [previous][next][first][last][top][bottom][index][help]  */