Lines Matching refs:cluster
351 pub fn get_fat_entry(&self, cluster: Cluster) -> Result<FATEntry, SystemError> { in get_fat_entry()
352 let current_cluster = cluster.cluster_num; in get_fat_entry()
365 fat_type.get_fat_bytes_offset(cluster, fat_start_sector, bytes_per_sec); in get_fat_entry()
450 pub fn get_fat_entry_raw(&self, cluster: Cluster) -> Result<u64, SystemError> { in get_fat_entry_raw()
451 let current_cluster = cluster.cluster_num; in get_fat_entry_raw()
460 fat_type.get_fat_bytes_offset(cluster, fat_start_sector, bytes_per_sec); in get_fat_entry_raw()
533 pub fn cluster_bytes_offset(&self, cluster: Cluster) -> u64 { in cluster_bytes_offset()
534 if cluster.cluster_num >= 2 { in cluster_bytes_offset()
536 let first_sec_of_cluster = (cluster.cluster_num - 2) in cluster_bytes_offset()
610 pub fn deallocate_cluster(&self, cluster: Cluster) -> Result<(), SystemError> { in deallocate_cluster()
611 let entry: FATEntry = self.get_fat_entry(cluster)?; in deallocate_cluster()
614 self.set_entry(cluster, FATEntry::Unused)?; in deallocate_cluster()
618 self.zero_cluster(cluster)?; in deallocate_cluster()
920 let mut cluster: u64 = start_cluster.cluster_num; in get_free_cluster() localVariable
945 let val = if (cluster & 0x1) > 0 { in get_free_cluster()
951 return Ok(Cluster::new(cluster as u64)); in get_free_cluster()
954 cluster += 1; in get_free_cluster()
957 if cluster == end_cluster.cluster_num || cluster == max_cluster.cluster_num { in get_free_cluster()
961 packed_val = match cluster & 1 { in get_free_cluster()
972 while cluster < end_cluster.cluster_num && cluster < max_cluster.cluster_num { in get_free_cluster()
974 Cluster::new(cluster), in get_free_cluster()
996 cluster += 1; in get_free_cluster()
1004 while cluster < end_cluster.cluster_num && cluster < max_cluster.cluster_num { in get_free_cluster()
1006 Cluster::new(cluster), in get_free_cluster()
1026 return Ok(Cluster::new(cluster)); in get_free_cluster()
1028 cluster += 1; in get_free_cluster()
1041 pub fn set_entry(&self, cluster: Cluster, fat_entry: FATEntry) -> Result<(), SystemError> { in set_entry()
1044 cluster, in set_entry()
1071 let new_val: u16 = if (cluster.cluster_num & 0x1) > 0 { in set_entry()
1134 && cluster.cluster_num >= 0x0ffffff7 in set_entry()
1135 && cluster.cluster_num <= 0x0fffffff in set_entry()
1139 cluster in set_entry()
1171 pub fn zero_cluster(&self, cluster: Cluster) -> Result<(), SystemError> { in zero_cluster()
1174 let offset: usize = self.cluster_bytes_offset(cluster) as usize; in zero_cluster()
1674 pub fn new(cluster: u64) -> Self { in new()
1676 cluster_num: cluster, in new()