projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't assume 4 kB pages.
[pintos-anon]
/
src
/
filesys
/
filehdr.h
diff --git
a/src/filesys/filehdr.h
b/src/filesys/filehdr.h
index 32792df804fc9172e03822ea54312e9943f5b7b2..60bca9619d452a26f08800cc089733b89e738491 100644
(file)
--- a/
src/filesys/filehdr.h
+++ b/
src/filesys/filehdr.h
@@
-1,19
+1,22
@@
-#ifndef
HEADER
_FILEHDR_H
-#define
HEADER_FILEHDR_H 1
+#ifndef
FILESYS
_FILEHDR_H
+#define
FILESYS_FILEHDR_H
#include <stdbool.h>
#include <stddef.h>
#include <stdbool.h>
#include <stddef.h>
-#include "
disk
.h"
-#include "
off_t
.h"
+#include "
filesys/off_t
.h"
+#include "
devices/disk
.h"
+/* Number of direct sector pointers in a file header. */
#define DIRECT_CNT ((DISK_SECTOR_SIZE - sizeof (off_t) * 2) \
/ sizeof (disk_sector_t))
#define DIRECT_CNT ((DISK_SECTOR_SIZE - sizeof (off_t) * 2) \
/ sizeof (disk_sector_t))
+/* File header.
+ This is both an in-memory and on-disk structure. */
struct filehdr
{
struct filehdr
{
- off_t length;
- size_t sector_cnt;
- disk_sector_t sectors[DIRECT_CNT];
+ off_t length;
/* File size in bytes. */
+ size_t sector_cnt;
/* File size in sectors. */
+ disk_sector_t sectors[DIRECT_CNT];
/* Sectors allocated for file. */
};
struct bitmap;
};
struct bitmap;
@@
-26,4
+29,4
@@
disk_sector_t filehdr_byte_to_sector (const struct filehdr *, off_t);
off_t filehdr_length (const struct filehdr *);
void filehdr_print (const struct filehdr *);
off_t filehdr_length (const struct filehdr *);
void filehdr_print (const struct filehdr *);
-#endif /* filehdr.h */
+#endif /* file
sys/file
hdr.h */