Add comments.
[pintos-anon] / src / filesys / filesys.c
index e42ad6fc9dca9108553ff106c0c6ed6c0c7ed6de..37ea07866ba6496a85dd43797bc7cb4d130d1444 100644 (file)
@@ -35,7 +35,7 @@ do_format (void)
 
   /* Allocate data sector(s) for the free map file
      and write its file header to disk. */
-  map_hdr = filehdr_allocate (&free_map, bitmap_storage_size (&free_map));
+  map_hdr = filehdr_allocate (&free_map, bitmap_file_size (&free_map));
   if (map_hdr == NULL)
     PANIC ("free map creation failed--disk is too large");
   filehdr_write (map_hdr, FREE_MAP_SECTOR);
@@ -72,9 +72,9 @@ do_format (void)
 void
 filesys_init (bool format) 
 {
-  filesys_disk = disk_get (1);
+  filesys_disk = disk_get (0, 1);
   if (filesys_disk == NULL)
-    PANIC ("ide1:1 not present, filesystem initialization failed");
+    PANIC ("hd0:1 (hdb) not present, filesystem initialization failed");
 
   if (format) 
     do_format ();
@@ -90,7 +90,7 @@ filesys_create (const char *name, off_t initial_size)
 {
   struct dir dir;
   struct bitmap free_map;
-  disk_sector_no hdr_sector;
+  disk_sector_t hdr_sector;
   struct filehdr *filehdr;
   bool success = false;
 
@@ -139,7 +139,7 @@ bool
 filesys_open (const char *name, struct file *file)
 {
   struct dir dir;
-  disk_sector_no hdr_sector;
+  disk_sector_t hdr_sector;
   bool success = false;
 
   if (!dir_init (&dir, NUM_DIR_ENTRIES))
@@ -156,7 +156,7 @@ bool
 filesys_remove (const char *name) 
 {
   struct dir dir;
-  disk_sector_no hdr_sector;
+  disk_sector_t hdr_sector;
   struct filehdr *filehdr;
   struct bitmap free_map;
   bool success = false;