summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2009-05-31 00:26:10 +0000
committerrsc <rsc>2009-05-31 00:26:10 +0000
commit0c7f483838c48db05e7ea44232a55135d7c262a0 (patch)
tree110a2d7fcc282d100d6d425ecfb9754f3c143328
parent74afa70d3051553df46d1ea0d76149a7a86c0a47 (diff)
downloadxv6-labs-0c7f483838c48db05e7ea44232a55135d7c262a0.tar.gz
xv6-labs-0c7f483838c48db05e7ea44232a55135d7c262a0.tar.bz2
xv6-labs-0c7f483838c48db05e7ea44232a55135d7c262a0.zip
move T_DIR etc into stat.h; move type up
-rw-r--r--fs.h4
-rw-r--r--mkfs.c1
-rw-r--r--stat.h6
3 files changed, 6 insertions, 5 deletions
diff --git a/fs.h b/fs.h
index a7d93b4..c86483e 100644
--- a/fs.h
+++ b/fs.h
@@ -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))
diff --git a/mkfs.c b/mkfs.c
index 3046f9b..24a4b4f 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -6,6 +6,7 @@
#include <assert.h>
#include "types.h"
#include "fs.h"
+#include "stat.h"
int nblocks = 995;
int ninodes = 200;
diff --git a/stat.h b/stat.h
index bc3a06c..604fa9c 100644
--- a/stat.h
+++ b/stat.h
@@ -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
};