Remove unwanted files.
[pintos-anon] / src / filesys / filehdr.h
index 7b0ecc234005887332b2eb6f97f7c9a55e0087ba..7c9f37f27ba1e510e282f4945cdd4fe5fcf5ddba 100644 (file)
@@ -3,26 +3,29 @@
 
 #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_no))
+                    / sizeof (disk_sector_t))
 
+/* File header.
+   This is both an in-memory and on-disk structure. */
 struct filehdr 
   {
-    off_t length;
-    size_t sector_cnt;
-    disk_sector_no 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 filehdr *filehdr_allocate (struct bitmap *, off_t length);
 void filehdr_deallocate (struct filehdr *, struct bitmap *);
-struct filehdr *filehdr_read (disk_sector_no);
-void filehdr_write (const struct filehdr *, disk_sector_no);
+struct filehdr *filehdr_read (disk_sector_t);
+void filehdr_write (const struct filehdr *, disk_sector_t);
 void filehdr_destroy (struct filehdr *);
-disk_sector_no filehdr_byte_to_sector (const struct filehdr *, off_t);
+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 *);