summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/btrfs.c4
-rw-r--r--src/ext2.c9
-rw-r--r--src/fat.c7
-rw-r--r--src/iso.c4
-rw-r--r--src/jfs.c5
-rw-r--r--src/ntfs.c5
6 files changed, 19 insertions, 15 deletions
diff --git a/src/btrfs.c b/src/btrfs.c
index 911f0c0..9585b24 100644
--- a/src/btrfs.c
+++ b/src/btrfs.c
@@ -41,8 +41,9 @@ static int test_btrfs(const struct btrfs_super_block *sb, partition_t *partition
static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition)
{
+ partition->blocksize=le32(sb->dev_item.sector_size);
set_part_name(partition, sb->label, sizeof(partition->partname));
- strncpy(partition->info,"btrfs",sizeof(partition->info));
+ snprintf(partition->info, sizeof(partition->info), "btrfs blocksize=%u", partition->blocksize);
if(le64(sb->bytenr)!=partition->part_offset + BTRFS_SUPER_INFO_OFFSET)
{
strcat(partition->info," Backup superblock");
@@ -94,7 +95,6 @@ int recover_btrfs(disk_t *disk, const struct btrfs_super_block *sb, partition_t
partition->part_type_sun=PSUN_LINUX;
partition->part_type_gpt=GPT_ENT_TYPE_LINUX_DATA;
partition->part_size=(uint64_t)le64(sb->dev_item.total_bytes);
- partition->blocksize=le32(sb->dev_item.sector_size);
guid_cpy(&partition->part_uuid, (const efi_guid_t *)&sb->fsid);
if(verbose>0)
{
diff --git a/src/ext2.c b/src/ext2.c
index ebafea1..0083c9d 100644
--- a/src/ext2.c
+++ b/src/ext2.c
@@ -60,6 +60,7 @@ int check_EXT2(disk_t *disk_car,partition_t *partition,const int verbose)
static int set_EXT2_info(const struct ext2_super_block *sb, partition_t *partition, const int verbose)
{
+ partition->blocksize=EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size);
set_part_name(partition,sb->s_volume_name,16);
/* sb->s_last_mounted seems to be unemployed in kernel 2.2.16 */
if(EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT4_FEATURE_RO_COMPAT_HUGE_FILE)!=0 ||
@@ -68,12 +69,11 @@ static int set_EXT2_info(const struct ext2_super_block *sb, partition_t *partiti
EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE)!=0 ||
EXT2_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_64BIT)!=0 ||
EXT2_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_MMP)!=0)
- strncpy(partition->info,"EXT4",sizeof(partition->info));
+ snprintf(partition->info, sizeof(partition->info), "ext4 blocksize=%u", partition->blocksize);
else if(EXT2_HAS_COMPAT_FEATURE(sb,EXT3_FEATURE_COMPAT_HAS_JOURNAL)!=0)
- strncpy(partition->info,"EXT3",sizeof(partition->info));
+ snprintf(partition->info, sizeof(partition->info), "ext3 blocksize=%u", partition->blocksize);
else
- strncpy(partition->info,"EXT2",sizeof(partition->info));
-
+ snprintf(partition->info, sizeof(partition->info), "ext2 blocksize=%u", partition->blocksize);
if(EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT2_FEATURE_RO_COMPAT_LARGE_FILE)!=0)
strcat(partition->info," Large file");
if(EXT2_HAS_RO_COMPAT_FEATURE(sb,EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)!=0)
@@ -120,7 +120,6 @@ int recover_EXT2(disk_t *disk, const struct ext2_super_block *sb,partition_t *pa
partition->part_type_sun=PSUN_LINUX;
partition->part_type_gpt=GPT_ENT_TYPE_LINUX_DATA;
partition->part_size=(uint64_t)le32(sb->s_blocks_count)*(EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size));
- partition->blocksize=EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size);
guid_cpy(&partition->part_uuid, (const efi_guid_t *)&sb->s_uuid);
if(verbose>0)
{
diff --git a/src/fat.c b/src/fat.c
index 5c045a7..8181f0f 100644
--- a/src/fat.c
+++ b/src/fat.c
@@ -198,10 +198,11 @@ static int set_FAT_info(disk_t *disk_car, const struct fat_boot_sector *fat_head
{
const char*buffer=(const char*)fat_header;
partition->fsname[0]='\0';
+ partition->blocksize=fat_sector_size(fat_header)* fat_header->sectors_per_cluster;
switch(partition->upart_type)
{
case UP_FAT12:
- snprintf(partition->info,sizeof(partition->info),"FAT12");
+ snprintf(partition->info, sizeof(partition->info), "FAT12, blocksize=%u", partition->blocksize);
if(buffer[38]==0x29) /* BS_BootSig */
{
set_part_name_chomp(partition,((const unsigned char*)fat_header)+FAT1X_PART_NAME,11);
@@ -210,7 +211,7 @@ static int set_FAT_info(disk_t *disk_car, const struct fat_boot_sector *fat_head
}
break;
case UP_FAT16:
- snprintf(partition->info,sizeof(partition->info),"FAT16");
+ snprintf(partition->info, sizeof(partition->info), "FAT16, blocksize=%u", partition->blocksize);
if(buffer[38]==0x29) /* BS_BootSig */
{
set_part_name_chomp(partition,((const unsigned char*)fat_header)+FAT1X_PART_NAME,11);
@@ -219,7 +220,7 @@ static int set_FAT_info(disk_t *disk_car, const struct fat_boot_sector *fat_head
}
break;
case UP_FAT32:
- snprintf(partition->info,sizeof(partition->info),"FAT32");
+ snprintf(partition->info, sizeof(partition->info), "FAT32, blocksize=%u", partition->blocksize);
fat32_set_part_name(disk_car,partition,fat_header);
break;
default:
diff --git a/src/iso.c b/src/iso.c
index da29d31..e05f63c 100644
--- a/src/iso.c
+++ b/src/iso.c
@@ -74,7 +74,10 @@ static int set_ISO_info(const struct iso_primary_descriptor *iso, partition_t *p
const unsigned int logical_block_size2=iso->logical_block_size[3] | (iso->logical_block_size[2]<<8);
set_part_name_chomp(partition, (const unsigned char*)iso->volume_id, 32);
if(volume_space_size==volume_space_size2 && logical_block_size==logical_block_size2)
+ {
+ partition->blocksize=logical_block_size;
snprintf(partition->info, sizeof(partition->info), "ISO9660");
+ }
else
snprintf(partition->info, sizeof(partition->info), "ISO");
return 0;
@@ -93,7 +96,6 @@ int recover_ISO(const struct iso_primary_descriptor *iso, partition_t *partition
if(volume_space_size==volume_space_size2 && logical_block_size==logical_block_size2)
{ /* ISO 9660 */
partition->part_size=(uint64_t)volume_space_size * logical_block_size;
- partition->blocksize=logical_block_size;
}
}
return 0;
diff --git a/src/jfs.c b/src/jfs.c
index 0733c81..ef1ecb6 100644
--- a/src/jfs.c
+++ b/src/jfs.c
@@ -60,7 +60,9 @@ int check_JFS(disk_t *disk_car, partition_t *partition)
static int set_JFS_info(const struct jfs_superblock *sb, partition_t *partition)
{
- snprintf(partition->info,sizeof(partition->info),"JFS %u",(unsigned int)le32(sb->s_version));
+ partition->blocksize=le32(sb->s_bsize);
+ snprintf(partition->info, sizeof(partition->info), "JFS %u, blocksize=%u",
+ (unsigned int)le32(sb->s_version), partition->blocksize);
partition->fsname[0]='\0';
if(le32(sb->s_version)==1)
{
@@ -86,7 +88,6 @@ int recover_JFS(disk_t *disk_car, const struct jfs_superblock *sb,partition_t *p
partition->sborg_offset=64*512;
partition->sb_size=JFS_SUPERBLOCK_SIZE;
partition->sb_offset=0;
- partition->blocksize=le32(sb->s_bsize);
guid_cpy(&partition->part_uuid, (const efi_guid_t *)&sb->s_uuid);
if(verbose>0)
{
diff --git a/src/ntfs.c b/src/ntfs.c
index 77eddba..9806a05 100644
--- a/src/ntfs.c
+++ b/src/ntfs.c
@@ -113,10 +113,11 @@ int recover_NTFS(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header,par
static int set_NTFS_info(disk_t *disk_car, const struct ntfs_boot_sector*ntfs_header,partition_t *partition,const int verbose)
{
partition->fsname[0]='\0';
+ partition->blocksize=ntfs_header->sectors_per_cluster*ntfs_sector_size(ntfs_header);
if(partition->sb_offset==0)
- strncpy(partition->info, "NTFS", sizeof(partition->info));
+ snprintf(partition->info, sizeof(partition->info), "NTFS, blocksize=%u", partition->blocksize);
else
- strncpy(partition->info, "NTFS found using backup sector!", sizeof(partition->info));
+ snprintf(partition->info, sizeof(partition->info), "NTFS found using backup sector, blocksize=%u", partition->blocksize);
return ntfs_read_MFT(disk_car, partition, ntfs_header, 0x60, verbose);
}