- partition_type = partition_start = partition_end = 0;
- sectors_per_cluster = bytes_per_cluster = reserved_sector_count = 0;
- number_fat = root_entries = sectors_per_fat = 0;
- number_cluster = fat_start = root_start = data_start = 0;
- next_free = filesystem_full = 0;
- fat32 = fsinfo_dirty = root_cluster = fsinfo_sector = free_count = 0;
- memset(&ao_file_dirent, '\0', sizeof (ao_file_dirent));
- ao_file_offset = ao_file_cluster_offset = ao_file_cluster = ao_file_opened = 0;
- if (!ao_fat_setup_partition())
- return 0;
- if (!ao_fat_setup_fs())
- return 0;
- return 1;
+ /* Re-initialize all global state; this will help to allow the
+ * file system to get swapped someday
+ */
+ partition_type = partition_start = partition_end = 0;
+ sectors_per_cluster = bytes_per_cluster = reserved_sector_count = 0;
+ number_fat = root_entries = sectors_per_fat = 0;
+ number_cluster = fat_start = root_start = data_start = 0;
+ next_free = filesystem_full = 0;
+ fat32 = fsinfo_dirty = root_cluster = fsinfo_sector = free_count = 0;
+ memset(&ao_file_dirent, '\0', sizeof (ao_file_dirent));
+
+ ao_file_offset = ao_file_cluster_offset = ao_file_cluster = ao_file_opened = 0;
+ if (!ao_fat_setup_partition())
+ return 0;
+ if (!ao_fat_setup_fs())
+ return 0;
+ ao_filesystem_available = 1;
+ }
+ return ao_filesystem_available;