Lines Matching refs:cluster
57 int cluster, idx; in fat32_alloc_clusters() local
62 cluster = finode->first_clus; in fat32_alloc_clusters()
72 cluster = tmp_clus; in fat32_alloc_clusters()
75 tmp_clus = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_alloc_clusters()
77 cluster = tmp_clus; in fat32_alloc_clusters()
87 fat32_write_FAT_entry(blk, fsbi, cluster, clusters[i]); in fat32_alloc_clusters()
88 cluster = clusters[i]; in fat32_alloc_clusters()
90 fat32_write_FAT_entry(blk, fsbi, cluster, 0x0ffffff8); in fat32_alloc_clusters()
112 int fat32_free_clusters(struct vfs_index_node_t *inode, int32_t cluster) in fat32_free_clusters() argument
126 uint32_t fat32_read_FAT_entry(struct block_device *blk, fat32_sb_info_t *fsbi, uint32_t cluster) in fat32_read_FAT_entry() argument
137 … fsbi->FAT1_base_sector + (cluster / fat_ent_per_sec), 1, (uint64_t)&buf); in fat32_read_FAT_entry()
140 return buf[cluster & (fat_ent_per_sec - 1)] & 0x0fffffff; in fat32_read_FAT_entry()
152 int fat32_write_FAT_entry(struct block_device *blk, fat32_sb_info_t *fsbi, uint32_t cluster, uint32… in fat32_write_FAT_entry() argument
160 … fsbi->FAT1_base_sector + (cluster / fat_ent_per_sec), 1, (uint64_t)buf); in fat32_write_FAT_entry()
162 …buf[cluster & (fat_ent_per_sec - 1)] = (buf[cluster & (fat_ent_per_sec - 1)] & 0xf0000000) | (valu… in fat32_write_FAT_entry()
165 … fsbi->FAT1_base_sector + (cluster / fat_ent_per_sec), 1, (uint64_t)buf); in fat32_write_FAT_entry()
167 … fsbi->FAT2_base_sector + (cluster / fat_ent_per_sec), 1, (uint64_t)buf); in fat32_write_FAT_entry()
198 uint32_t cluster = finode->first_clus; in fat32_find_empty_dentry() local
207 uint64_t sector = fsbi->first_data_sector + (cluster - 2) * fsbi->sec_per_clus; in fat32_find_empty_dentry()
236 *res_cluster = cluster; in fat32_find_empty_dentry()
242 uint64_t old_cluster = cluster; in fat32_find_empty_dentry()
243 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_find_empty_dentry()
244 if (cluster >= 0x0ffffff7) // 寻找完父目录的所有簇,都没有找到符合要求的空目录项 in fat32_find_empty_dentry()
249 if (fat32_alloc_clusters(parent_inode, &cluster, 1) != 0) in fat32_find_empty_dentry()
257 sector = fsbi->first_data_sector + (cluster - 2) * fsbi->sec_per_clus; in fat32_find_empty_dentry()
321 …_fill_shortname(struct vfs_dir_entry_t *dEntry, struct fat32_Directory_t *target, uint32_t cluster) in fat32_fill_shortname() argument
368 target->DIR_FstClusHI = (uint16_t)((cluster >> 16) & 0x0fff); in fat32_fill_shortname()
369 target->DIR_FstClusLO = (uint16_t)(cluster & 0xffff); in fat32_fill_shortname()