Lines Matching refs:bpb
28 bpb::{BiosParameterBlock, FATType},
65 pub bpb: BiosParameterBlock, field
182 blk_size: fs.bpb.bytes_per_sector as usize, in new()
183 blocks: if let FATType::FAT32(_) = fs.bpb.fat_type { in new()
184 fs.bpb.total_sectors_32 as usize in new()
186 fs.bpb.total_sectors_16 as usize in new()
253 let bpb = BiosParameterBlock::new(partition.clone())?; in new() localVariable
256 let fs_info: FATFsInfo = match bpb.fat_type { in new()
259 + bpb32.fs_info as u64 * bpb.bytes_per_sector as u64; in new()
263 bpb.bytes_per_sector as usize, in new()
270 let root_dir_sectors: u64 = ((bpb.root_entries_cnt as u64 * 32) in new()
271 + (bpb.bytes_per_sector as u64 - 1)) in new()
272 / (bpb.bytes_per_sector as u64); in new()
275 let fat_size = if bpb.fat_size_16 != 0 { in new()
276 bpb.fat_size_16 as u64 in new()
278 match bpb.fat_type { in new()
288 bpb.rsvd_sec_cnt as u64 + (bpb.num_fats as u64 * fat_size) + root_dir_sectors; in new()
301 blk_size: bpb.bytes_per_sector as usize, in new()
302 blocks: if let FATType::FAT32(_) = bpb.fat_type { in new()
303 bpb.total_sectors_32 as usize in new()
305 bpb.total_sectors_16 as usize in new()
321 bpb, in new()
342 return (self.bpb.bytes_per_sector as u64) * (self.bpb.sector_per_cluster as u64); in bytes_per_cluster()
354 let fat_type: FATType = self.bpb.fat_type; in get_fat_entry()
357 let bytes_per_sec = self.bpb.bytes_per_sector as u64; in get_fat_entry()
371 v.resize(self.bpb.bytes_per_sector as usize, 0); in get_fat_entry()
379 let res: FATEntry = match self.bpb.fat_type { in get_fat_entry()
449 let fat_type: FATType = self.bpb.fat_type; in get_fat_entry_raw()
452 let bytes_per_sec = self.bpb.bytes_per_sector as u64; in get_fat_entry_raw()
465 v.resize(self.bpb.bytes_per_sector as usize, 0); in get_fat_entry_raw()
473 let res = match self.bpb.fat_type { in get_fat_entry_raw()
498 match self.bpb.fat_type { in root_dir_bytes_offset()
501 * (self.bpb.sector_per_cluster as u64) in root_dir_bytes_offset()
506 let root_sec = (self.bpb.rsvd_sec_cnt as u64) in root_dir_bytes_offset()
507 + (self.bpb.num_fats as u64) * (self.bpb.fat_size_16 as u64); in root_dir_bytes_offset()
516 match self.bpb.fat_type { in root_dir_end_bytes_offset()
519 self.root_dir_bytes_offset() + (self.bpb.root_entries_cnt as u64) * 32, in root_dir_end_bytes_offset()
533 * (self.bpb.sector_per_cluster as u64) in cluster_bytes_offset()
549 let start_cluster: Cluster = match self.bpb.fat_type { in allocate_cluster()
625 match self.bpb.fat_type { in root_dir()
649 return self.bpb.rsvd_sec_cnt as u64 + active_fat * fat_size; in fat_start_sector()
657 match self.bpb.fat_type { in active_fat()
670 if self.bpb.fat_size_16 != 0 { in fat_size()
671 return self.bpb.fat_size_16 as u64; in fat_size()
673 match self.bpb.fat_type { in fat_size()
687 match self.bpb.fat_type { in mirroring_enabled()
701 + in_partition_sec_offset * (self.bpb.bytes_per_sector as u64 / LBA_SIZE as u64)) in get_lba_from_offset()
708 return self.bpb.bytes_per_sector as usize / LBA_SIZE; in lba_per_sector()
714 return in_partition_bytes_offset / (self.bpb.bytes_per_sector as u64); in bytes_to_sector()
774 match self.bpb.fat_type { in is_shut_bit_ok()
797 match self.bpb.fat_type { in is_hard_error_bit_ok()
816 match self.bpb.fat_type { in set_shut_bit_ok()
839 match self.bpb.fat_type { in set_hard_error_bit_ok()
870 match self.bpb.fat_type { in max_cluster_number()
875 let data_sec: u64 = self.bpb.total_sectors_32 as u64 in max_cluster_number()
876 - (self.bpb.rsvd_sec_cnt as u64 in max_cluster_number()
877 + self.bpb.num_fats as u64 * s.fat_size_32 as u64); in max_cluster_number()
880 let total_clusters: u64 = data_sec / self.bpb.sector_per_cluster as u64; in max_cluster_number()
888 let root_dir_sectors: u64 = (((self.bpb.root_entries_cnt as u64) * 32) in max_cluster_number()
889 + self.bpb.bytes_per_sector as u64 in max_cluster_number()
891 / self.bpb.bytes_per_sector as u64; in max_cluster_number()
893 let data_sec: u64 = self.bpb.total_sectors_16 as u64 in max_cluster_number()
894 - (self.bpb.rsvd_sec_cnt as u64 in max_cluster_number()
895 + (self.bpb.num_fats as u64 * self.bpb.fat_size_16 as u64) in max_cluster_number()
897 let total_clusters = data_sec / self.bpb.sector_per_cluster as u64; in max_cluster_number()
918 let fat_type: FATType = self.bpb.fat_type; in get_free_cluster()
920 let bytes_per_sec: u64 = self.bpb.bytes_per_sector as u64; in get_free_cluster()
1039 let fat_part_bytes_offset: u64 = self.bpb.fat_type.get_fat_bytes_offset( in set_entry()
1042 self.bpb.bytes_per_sector as u64, in set_entry()
1045 match self.bpb.fat_type { in set_entry()
1109 self.bpb.num_fats as u64 in set_entry()