Lines Matching refs:u64

34 pub const MAX_FILE_SIZE: u64 = 0xffff_ffff;
40 pub cluster_num: u64,
41 pub parent_cluster: u64,
67 pub first_data_sector: u64,
225 offset: Option<u64>,
258 let fs_info_in_disk_bytes_offset = partition.lba_start * LBA_SIZE as u64 in new()
259 + bpb32.fs_info as u64 * bpb.bytes_per_sector as u64; 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()
276 bpb.fat_size_16 as u64 in new()
279 FATType::FAT32(x) => x.fat_size_32 as u64, in new()
288 bpb.rsvd_sec_cnt as u64 + (bpb.num_fats as u64 * fat_size) + root_dir_sectors; in new()
341 pub fn bytes_per_cluster(&self) -> u64 { in bytes_per_cluster() argument
342 return (self.bpb.bytes_per_sector as u64) * (self.bpb.sector_per_cluster as u64); in bytes_per_cluster()
361 let bytes_per_sec = self.bpb.bytes_per_sector as u64; in get_fat_entry()
369 let fat_ent_lba = self.partition.lba_start + fat_bytes_offset / LBA_SIZE as u64; in get_fat_entry()
401 cluster_num: entry as u64, in get_fat_entry()
417 cluster_num: entry as u64, in get_fat_entry()
435 cluster_num: entry as u64, in get_fat_entry()
450 pub fn get_fat_entry_raw(&self, cluster: Cluster) -> Result<u64, SystemError> { in get_fat_entry_raw() argument
456 let bytes_per_sec = self.bpb.bytes_per_sector as u64; in get_fat_entry_raw()
485 entry as u64 in get_fat_entry_raw()
488 let entry = (cursor.read_u16()?) as u64; in get_fat_entry_raw()
493 entry as u64 in get_fat_entry_raw()
501 pub fn root_dir_bytes_offset(&self) -> u64 { in root_dir_bytes_offset() argument
504 let first_sec_cluster: u64 = (s.root_cluster as u64 - 2) in root_dir_bytes_offset()
505 * (self.bpb.sector_per_cluster as u64) in root_dir_bytes_offset()
507 return (self.get_lba_from_offset(first_sec_cluster) * LBA_SIZE) as u64; in root_dir_bytes_offset()
510 let root_sec = (self.bpb.rsvd_sec_cnt as u64) in root_dir_bytes_offset()
511 + (self.bpb.num_fats as u64) * (self.bpb.fat_size_16 as u64); in root_dir_bytes_offset()
512 return (self.get_lba_from_offset(root_sec) * LBA_SIZE) as u64; in root_dir_bytes_offset()
519 pub fn root_dir_end_bytes_offset(&self) -> Option<u64> { in root_dir_end_bytes_offset() argument
523 self.root_dir_bytes_offset() + (self.bpb.root_entries_cnt as u64) * 32, in root_dir_end_bytes_offset()
533 pub fn cluster_bytes_offset(&self, cluster: Cluster) -> u64 { in cluster_bytes_offset() argument
537 * (self.bpb.sector_per_cluster as u64) in cluster_bytes_offset()
539 return (self.get_lba_from_offset(first_sec_of_cluster) * LBA_SIZE) as u64; in cluster_bytes_offset()
555 let next_free: u64 = match self.fs_info.0.lock().next_free() { in allocate_cluster()
562 Cluster::new(RESERVED_CLUSTERS as u64) in allocate_cluster()
565 _ => Cluster::new(RESERVED_CLUSTERS as u64), in allocate_cluster()
571 Err(_) if start_cluster.cluster_num > RESERVED_CLUSTERS as u64 => { in allocate_cluster()
572 self.get_free_cluster(Cluster::new(RESERVED_CLUSTERS as u64), end_cluster)? in allocate_cluster()
632 first_cluster: Cluster::new(s.root_cluster as u64), in root_dir()
650 pub fn fat_start_sector(&self) -> u64 { in fat_start_sector() argument
653 return self.bpb.rsvd_sec_cnt as u64 + active_fat * fat_size; in fat_start_sector()
657 pub fn active_fat(&self) -> u64 { in active_fat() argument
663 return (bpb32.ext_flags & 0x0f) as u64; in active_fat()
673 pub fn fat_size(&self) -> u64 { in fat_size() argument
675 return self.bpb.fat_size_16 as u64; in fat_size()
679 return bpb32.fat_size_32 as u64; in fat_size()
703 pub fn get_lba_from_offset(&self, in_partition_sec_offset: u64) -> usize { in get_lba_from_offset()
705 + in_partition_sec_offset * (self.bpb.bytes_per_sector as u64 / LBA_SIZE as u64)) in get_lba_from_offset()
717 pub fn bytes_to_sector(&self, in_partition_bytes_offset: u64) -> u64 { in bytes_to_sector() argument
718 return in_partition_bytes_offset / (self.bpb.bytes_per_sector as u64); in bytes_to_sector()
723 pub fn get_in_partition_bytes_offset(&self, disk_bytes_offset: u64) -> u64 { in get_in_partition_bytes_offset() argument
724 return disk_bytes_offset - (self.partition.lba_start * LBA_SIZE as u64); in get_in_partition_bytes_offset()
729 pub fn get_in_block_offset(&self, bytes_offset: u64) -> u64 { in get_in_block_offset() argument
730 return bytes_offset % LBA_SIZE as u64; in get_in_block_offset()
743 pub fn num_clusters_chain(&self, start_cluster: Cluster) -> u64 { in num_clusters_chain() argument
879 let data_sec: u64 = self.bpb.total_sectors_32 as u64 in max_cluster_number()
880 - (self.bpb.rsvd_sec_cnt as u64 in max_cluster_number()
881 + self.bpb.num_fats as u64 * s.fat_size_32 as u64); in max_cluster_number()
884 let total_clusters: u64 = data_sec / self.bpb.sector_per_cluster as u64; in max_cluster_number()
887 return Cluster::new(total_clusters + RESERVED_CLUSTERS as u64 - 1); in max_cluster_number()
892 let root_dir_sectors: u64 = (((self.bpb.root_entries_cnt as u64) * 32) in max_cluster_number()
893 + self.bpb.bytes_per_sector as u64 in max_cluster_number()
895 / self.bpb.bytes_per_sector as u64; in max_cluster_number()
897 let data_sec: u64 = self.bpb.total_sectors_16 as u64 in max_cluster_number()
898 - (self.bpb.rsvd_sec_cnt as u64 in max_cluster_number()
899 + (self.bpb.num_fats as u64 * self.bpb.fat_size_16 as u64) in max_cluster_number()
901 let total_clusters = data_sec / self.bpb.sector_per_cluster as u64; in max_cluster_number()
902 return Cluster::new(total_clusters + RESERVED_CLUSTERS as u64 - 1); in max_cluster_number()
920 let mut cluster: u64 = start_cluster.cluster_num; in get_free_cluster()
923 let fat_start_sector: u64 = self.fat_start_sector(); in get_free_cluster()
924 let bytes_per_sec: u64 = self.bpb.bytes_per_sector as u64; in get_free_cluster()
928 let part_bytes_offset: u64 = in get_free_cluster()
951 return Ok(Cluster::new(cluster as u64)); in get_free_cluster()
973 let part_bytes_offset: u64 = fat_type.get_fat_bytes_offset( in get_free_cluster()
994 return Ok(Cluster::new(val as u64)); in get_free_cluster()
1005 let part_bytes_offset: u64 = fat_type.get_fat_bytes_offset( in get_free_cluster()
1043 let fat_part_bytes_offset: u64 = self.bpb.fat_type.get_fat_bytes_offset( in set_entry()
1046 self.bpb.bytes_per_sector as u64, in set_entry()
1109 let fat_size: u64 = self.fat_size(); in set_entry()
1110 let bound: u64 = if self.mirroring_enabled() { in set_entry()
1113 self.bpb.num_fats as u64 in set_entry()
1118 let f_offset: u64 = fat_part_bytes_offset + i * fat_size; in set_entry()
1119 let in_block_offset: u64 = self.get_in_block_offset(f_offset); in set_entry()
1199 const FS_INFO_SIZE: u64 = 512;
1208 in_disk_fs_info_offset: u64, in new() argument
1252 pub fn count_free_cluster(&self, max_cluster: Cluster) -> Option<u64> { in count_free_cluster() argument
1253 let count_clusters = max_cluster.cluster_num - RESERVED_CLUSTERS as u64 + 1; in count_free_cluster()
1255 if self.free_count as u64 > count_clusters { in count_free_cluster()
1262 n => return Some(n as u64), in count_free_cluster()
1290 pub fn next_free(&self) -> Option<u64> { in next_free() argument
1294 n => return Some(n as u64), in next_free()
1303 let in_block_offset = off % LBA_SIZE as u64; in flush()
1332 let in_block_offset = off % LBA_SIZE as u64; in update()
1368 offset as u64, in read_at()
1395 let r = f.write(fs, &buf[0..len], offset as u64); in write_at()
1488 file.write(fs, &buf[0..write_size], offset as u64)?; in resize()
1493 file.truncate(fs, len as u64)?; in resize()
1674 pub fn new(cluster: u64) -> Self { in new()