Lines Matching refs:fsbi
60 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)parent_inode->sb->private_sb_info; in __fat32_search_long_short() local
63 uint8_t *buf = kzalloc(fsbi->bytes_per_clus, 0); in __fat32_search_long_short()
75 … uint64_t sector = __fat32_calculate_LBA(fsbi->first_data_sector, fsbi->sec_per_clus, cluster); in __fat32_search_long_short()
80 …blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_READ_DMA_EXT, sector, fsbi->sec_per_clus, (uin… in __fat32_search_long_short()
85 for (int i = 0; i < fsbi->bytes_per_clus; i += 32, ++tmp_dEntry) in __fat32_search_long_short()
283 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in __fat32_search_long_short()
302 sinfo->i_pos = __fat32_calculate_LBA(fsbi->first_data_sector, fsbi->sec_per_clus, cluster); in __fat32_search_long_short()
319 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)parent_inode->sb->private_sb_info; in fat32_lookup() local
333 p->blocks = (p->file_size + fsbi->bytes_per_clus - 1) / fsbi->bytes_per_sec; in fat32_lookup()
344 …finode->dEntry_location_clus = __fat32_LBA_to_cluster(fsbi->first_data_sector, fsbi->sec_per_clus,… in fat32_lookup()
389 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)(sb_ptr->private_sb_info); in fat32_read_superblock() local
391 fsbi->starting_sector = blk->bd_start_LBA; in fat32_read_superblock()
392 fsbi->sector_count = blk->bd_sectors_num; in fat32_read_superblock()
393 fsbi->sec_per_clus = fbs->BPB_SecPerClus; in fat32_read_superblock()
394 fsbi->bytes_per_clus = fbs->BPB_SecPerClus * fbs->BPB_BytesPerSec; in fat32_read_superblock()
395 fsbi->bytes_per_sec = fbs->BPB_BytesPerSec; in fat32_read_superblock()
396 …fsbi->first_data_sector = blk->bd_start_LBA + fbs->BPB_RsvdSecCnt + fbs->BPB_FATSz32 * fbs->BPB_Nu… in fat32_read_superblock()
397 fsbi->FAT1_base_sector = blk->bd_start_LBA + fbs->BPB_RsvdSecCnt; in fat32_read_superblock()
398 fsbi->FAT2_base_sector = fsbi->FAT1_base_sector + fbs->BPB_FATSz32; in fat32_read_superblock()
399 fsbi->sec_per_FAT = fbs->BPB_FATSz32; in fat32_read_superblock()
400 fsbi->NumFATs = fbs->BPB_NumFATs; in fat32_read_superblock()
401 fsbi->fsinfo_sector_addr_infat = fbs->BPB_FSInfo; in fat32_read_superblock()
402 fsbi->bootsector_bak_sector_addr_infat = fbs->BPB_BkBootSec; in fat32_read_superblock()
409 memset(&fsbi->fsinfo, 0, sizeof(struct fat32_FSInfo_t)); in fat32_read_superblock()
411 … blk->bd_start_LBA + fsbi->fsinfo_sector_addr_infat, 1, (uint64_t)&fsbi->fsinfo); in fat32_read_superblock()
414 fsbi->fsinfo.FSI_LeadSig, fsbi->fsinfo.FSI_StrucSig, fsbi->fsinfo.FSI_Free_Count); in fat32_read_superblock()
432 (sb_ptr->root->dir_inode->file_size + fsbi->bytes_per_clus - 1) / fsbi->bytes_per_sec; in fat32_read_superblock()
490 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)inode->sb->private_sb_info; in fat32_write_inode() local
493 … uint64_t fLBA = fsbi->first_data_sector + (finode->dEntry_location_clus - 2) * fsbi->sec_per_clus; in fat32_write_inode()
495 struct fat32_Directory_t *buf = (struct fat32_Directory_t *)kmalloc(fsbi->bytes_per_clus, 0); in fat32_write_inode()
496 memset(buf, 0, fsbi->bytes_per_clus); in fat32_write_inode()
499 fsbi->sec_per_clus, (uint64_t)buf); in fat32_write_inode()
510 fsbi->sec_per_clus, (uint64_t)buf); in fat32_write_inode()
577 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)(file_ptr->dEntry->dir_inode->sb->private_sb_info); in fat32_read() local
588 uint64_t clus_offset_in_file = (*position) / fsbi->bytes_per_clus; in fat32_read()
590 uint64_t bytes_offset = (*position) % fsbi->bytes_per_clus; in fat32_read()
597 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_read()
607 void *tmp_buffer = kmalloc(fsbi->bytes_per_clus, 0); in fat32_read()
613 memset(tmp_buffer, 0, fsbi->bytes_per_clus); in fat32_read()
614 uint64_t sector = fsbi->first_data_sector + (cluster - 2) * fsbi->sec_per_clus; in fat32_read()
617 …int errno = blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_READ_DMA_EXT, sector, fsbi->sec_pe… in fat32_read()
627 if (bytes_remain > (fsbi->bytes_per_clus - bytes_offset)) in fat32_read()
628 step_trans_len = (fsbi->bytes_per_clus - bytes_offset); in fat32_read()
643 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_read()
665 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)(file_ptr->dEntry->dir_inode->sb->private_sb_info); in fat32_write() local
673 uint64_t clus_offset_in_file = (*position) / fsbi->bytes_per_clus; in fat32_write()
675 uint64_t bytes_offset = (*position) % fsbi->bytes_per_clus; in fat32_write()
687 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_write()
702 void *tmp_buffer = kmalloc(fsbi->bytes_per_clus, 0); in fat32_write()
705 memset(tmp_buffer, 0, fsbi->bytes_per_clus); in fat32_write()
706 sector = fsbi->first_data_sector + (cluster - 2) * fsbi->sec_per_clus; // 计算对应的扇区 in fat32_write()
711 …rno = blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_READ_DMA_EXT, sector, fsbi->sec_per_clus, in fat32_write()
722 if (bytes_remain > (fsbi->bytes_per_clus - bytes_offset)) in fat32_write()
723 step_trans_len = (fsbi->bytes_per_clus - bytes_offset); in fat32_write()
734 …int errno = blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_WRITE_DMA_EXT, sector, fsbi->sec_p… in fat32_write()
752 next_clus = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_write()
851 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)parent_inode->sb->private_sb_info; in fat32_create() local
877 inode->blocks = fsbi->sec_per_clus; in fat32_create()
925 …blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_WRITE_DMA_EXT, tmp_dentry_sector, fsbi->sec_pe… in fat32_create()
955 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)parent_inode->sb->private_sb_info; in fat32_mkdir() local
982 inode->blocks = fsbi->sec_per_clus; in fat32_mkdir()
1027 …blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_WRITE_DMA_EXT, tmp_dentry_sector, fsbi->sec_pe… in fat32_mkdir()
1032 void *buf = kmalloc(fsbi->bytes_per_clus, 0); in fat32_mkdir()
1034 memset((void *)new_dir_dentries, 0, fsbi->bytes_per_clus); in fat32_mkdir()
1059 uint64_t sector = fsbi->first_data_sector + (new_dir_clus - 2) * fsbi->sec_per_clus; in fat32_mkdir()
1061 …blk->bd_disk->fops->transfer(blk->bd_disk, AHCI_CMD_WRITE_DMA_EXT, sector, fsbi->sec_per_clus, (ui… in fat32_mkdir()
1126 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)sb->private_sb_info; in fat32_unlink() local
1160 fat32_sb_info_t *fsbi = (fat32_sb_info_t *)file_ptr->dEntry->dir_inode->sb->private_sb_info; in fat32_readdir() local
1163 unsigned char *buf = (unsigned char *)kzalloc(fsbi->bytes_per_clus, 0); in fat32_readdir()
1167 int clus_num = file_ptr->position / fsbi->bytes_per_clus; in fat32_readdir()
1172 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_readdir()
1188 uint64_t sector = fsbi->first_data_sector + (cluster - 2) * fsbi->sec_per_clus; in fat32_readdir()
1192 fsbi->sec_per_clus, (uint64_t)buf)) in fat32_readdir()
1204 dentry = (struct fat32_Directory_t *)(buf + file_ptr->position % fsbi->bytes_per_clus); in fat32_readdir()
1208 for (int i = file_ptr->position % fsbi->bytes_per_clus; i < fsbi->bytes_per_clus; in fat32_readdir()
1323 cluster = fat32_read_FAT_entry(blk, fsbi, cluster); in fat32_readdir()