move T_DIR etc into stat.h; move type up
This commit is contained in:
parent
74afa70d30
commit
0c7f483838
3 changed files with 6 additions and 5 deletions
4
fs.h
4
fs.h
|
@ -31,10 +31,6 @@ struct dinode {
|
||||||
uint addrs[NADDRS]; // Data block addresses
|
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.
|
// Inodes per block.
|
||||||
#define IPB (BSIZE / sizeof(struct dinode))
|
#define IPB (BSIZE / sizeof(struct dinode))
|
||||||
|
|
||||||
|
|
1
mkfs.c
1
mkfs.c
|
@ -6,6 +6,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "fs.h"
|
#include "fs.h"
|
||||||
|
#include "stat.h"
|
||||||
|
|
||||||
int nblocks = 995;
|
int nblocks = 995;
|
||||||
int ninodes = 200;
|
int ninodes = 200;
|
||||||
|
|
6
stat.h
6
stat.h
|
@ -1,7 +1,11 @@
|
||||||
|
#define T_DIR 1 // Directory
|
||||||
|
#define T_FILE 2 // File
|
||||||
|
#define T_DEV 3 // Special device
|
||||||
|
|
||||||
struct stat {
|
struct stat {
|
||||||
|
short type; // Type of file
|
||||||
int dev; // Device number
|
int dev; // Device number
|
||||||
uint ino; // Inode number on device
|
uint ino; // Inode number on device
|
||||||
short type; // Type of file
|
|
||||||
short nlink; // Number of links to file
|
short nlink; // Number of links to file
|
||||||
uint size; // Size of file in bytes
|
uint size; // Size of file in bytes
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue