diff --git a/fs.h b/fs.h
index a7d93b4a6054d81dfb5456d057529e3dcb2533fa..c86483e39e41d52c47f646fe172162aa7617cf15 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 3046f9bfca64ffd913a3b461d2e49cb8c55dce6f..24a4b4f8da87e27cc93701a529a3cb157ccad00d 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 bc3a06c747ec0552e023cda856e92e6f6ca36aee..604fa9ccbc993a2ca446e2719d74864b537120cb 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
 };