xv6-cs450/fs.h

35 lines
502 B
C
Raw Normal View History

// on-disk file system format
// second sector
struct superblock{
int nblocks;
int ninodes;
};
2006-08-08 20:07:37 +02:00
#define NDIRECT 13
// inodes start at the third sector
// and blocks start at (ninodes * sizeof(dinode) + 511) / 512
struct dinode {
short type;
2006-08-08 20:07:37 +02:00
short major;
short minor;
short nlink;
uint size;
uint addrs[NDIRECT];
};
2006-08-08 20:07:37 +02:00
#define T_DIR 1
#define T_FILE 2
2006-08-08 20:07:37 +02:00
#define T_DEV 3
#define IPB (512 / sizeof(struct dinode))
2006-07-22 00:10:40 +02:00
#define DIRSIZ 14
struct dirent {
ushort inum;
2006-07-22 00:10:40 +02:00
char name[DIRSIZ];
};