Skip to content

Commit

Permalink
move T_DIR etc into stat.h; move type up
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed May 31, 2009
1 parent 74afa70 commit 0c7f483
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 0 additions & 4 deletions fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ struct dinode {
uint addrs[NADDRS]; // Data block addresses
};

#define T_DIR 1 // Directory
#define T_FILE 2 // File
#define T_DEV 3 // Special device

// Inodes per block.
#define IPB (BSIZE / sizeof(struct dinode))

Expand Down
1 change: 1 addition & 0 deletions mkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <assert.h>
#include "types.h"
#include "fs.h"
#include "stat.h"

int nblocks = 995;
int ninodes = 200;
Expand Down
6 changes: 5 additions & 1 deletion stat.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#define T_DIR 1 // Directory
#define T_FILE 2 // File
#define T_DEV 3 // Special device

struct stat {
short type; // Type of file
int dev; // Device number
uint ino; // Inode number on device
short type; // Type of file
short nlink; // Number of links to file
uint size; // Size of file in bytes
};

0 comments on commit 0c7f483

Please sign in to comment.