kern
diff src/fs.h @ 96:07fe6a614185
filesystem
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 15 Dec 2011 04:39:00 +0200 |
parents | ec62cbe00b55 |
children | 8717eb590727 |
line diff
1.1 --- a/src/fs.h Sun Dec 11 21:15:35 2011 +0200 1.2 +++ b/src/fs.h Thu Dec 15 04:39:00 2011 +0200 1.3 @@ -3,9 +3,12 @@ 1.4 1.5 #include <inttypes.h> 1.6 1.7 -#define MAGIC 0xccf5ccf5 1.8 -#define FS_VER 1 1.9 -#define BLKSZ 1024 1.10 +#define MAGIC 0xccf5ccf5 1.11 +#define FS_VER 1 1.12 +#define BLKSZ 1024 1.13 + 1.14 +#define NAME_MAX 27 /* +1 termin. +4 ino = 32 per dirent */ 1.15 +#define PATH_MAX 256 1.16 1.17 #define SECT_TO_BLK(x) ((x) / (BLKSZ / 512)) 1.18 1.19 @@ -32,6 +35,10 @@ 1.20 blkid dind; /* double-indirect */ 1.21 } __attribute__((packed)); 1.22 1.23 +struct dir_entry { 1.24 + int ino; 1.25 + char name[NAME_MAX + 1]; 1.26 +} __attribute__((packed)); 1.27 1.28 struct superblock { 1.29 uint32_t magic; /* magic number */ 1.30 @@ -74,6 +81,7 @@ 1.31 1.32 /* defined in fs.c */ 1.33 int openfs(struct filesys *fs, dev_t dev); 1.34 +int mkfs(struct filesys *fs, dev_t dev); 1.35 void closefs(struct filesys *fs); 1.36 int find_inode(const char *path); 1.37