summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/adv.c1
-rw-r--r--src/common.h1
-rw-r--r--src/partnone.c2
-rw-r--r--src/xfs.c54
-rw-r--r--src/xfs.h1
5 files changed, 33 insertions, 26 deletions
diff --git a/src/adv.c b/src/adv.c
index 5786047..02ac564 100644
--- a/src/adv.c
+++ b/src/adv.c
@@ -119,6 +119,7 @@ static int is_linux(const partition_t *partition)
case UP_XFS2:
case UP_XFS3:
case UP_XFS4:
+ case UP_XFS5:
return 1;
default:
break;
diff --git a/src/common.h b/src/common.h
index c2c684b..3f70270 100644
--- a/src/common.h
+++ b/src/common.h
@@ -271,6 +271,7 @@ enum upart_type {
UP_XFS2,
UP_XFS3,
UP_XFS4,
+ UP_XFS5,
UP_ZFS};
typedef enum upart_type upart_type_t;
enum status_type { STATUS_DELETED, STATUS_PRIM, STATUS_PRIM_BOOT, STATUS_LOG, STATUS_EXT, STATUS_EXT_IN_EXT};
diff --git a/src/partnone.c b/src/partnone.c
index 7e23f01..13c4cdc 100644
--- a/src/partnone.c
+++ b/src/partnone.c
@@ -137,6 +137,7 @@ static const struct systypes none_sys_types[] = {
{UP_XFS2, "XFS 2"},
{UP_XFS3, "XFS 3"},
{UP_XFS4, "XFS 4"},
+ {UP_XFS5, "XFS 5"},
{UP_ZFS, "ZFS"},
{ 0,NULL }
};
@@ -451,6 +452,7 @@ static int check_part_none(disk_t *disk_car,const int verbose,partition_t *parti
case UP_XFS2:
case UP_XFS3:
case UP_XFS4:
+ case UP_XFS5:
ret=check_xfs(disk_car,partition,verbose);
break;
case UP_ZFS:
diff --git a/src/xfs.c b/src/xfs.c
index a5c2e87..07db3f9 100644
--- a/src/xfs.c
+++ b/src/xfs.c
@@ -38,8 +38,8 @@
#include "log.h"
#include "guid_cpy.h"
-static int set_xfs_info(const struct xfs_sb *sb, partition_t *partition);
-static int test_xfs(const disk_t *disk_car, const struct xfs_sb *sb, partition_t *partition, const int verbose);
+static void set_xfs_info(const struct xfs_sb *sb, partition_t *partition);
+static int test_xfs(const disk_t *disk_car, const struct xfs_sb *sb, const partition_t *partition, const int verbose);
int check_xfs(disk_t *disk_car,partition_t *partition,const int verbose)
{
@@ -59,7 +59,7 @@ int check_xfs(disk_t *disk_car,partition_t *partition,const int verbose)
return 0;
}
-static int test_xfs(const disk_t *disk_car, const struct xfs_sb *sb, partition_t *partition, const int verbose)
+static int test_xfs(const disk_t *disk_car, const struct xfs_sb *sb, const partition_t *partition, const int verbose)
{
if(sb->sb_magicnum!=be32(XFS_SB_MAGIC) ||
(uint16_t)be16(sb->sb_sectsize) != (1U << sb->sb_sectlog) ||
@@ -69,20 +69,13 @@ static int test_xfs(const disk_t *disk_car, const struct xfs_sb *sb, partition_t
switch(be16(sb->sb_versionnum) & XFS_SB_VERSION_NUMBITS)
{
case XFS_SB_VERSION_1:
- partition->upart_type = UP_XFS;
- break;
case XFS_SB_VERSION_2:
- partition->upart_type = UP_XFS2;
- break;
case XFS_SB_VERSION_3:
- partition->upart_type = UP_XFS3;
- break;
case XFS_SB_VERSION_4:
- partition->upart_type = UP_XFS4;
+ case XFS_SB_VERSION_5:
break;
default:
- log_error("Unknown XFS version %x\n",be16(sb->sb_versionnum)& XFS_SB_VERSION_NUMBITS);
- partition->upart_type = UP_XFS4;
+ log_error("Unknown XFS version 0x%x\n",be16(sb->sb_versionnum)& XFS_SB_VERSION_NUMBITS);
break;
}
if(verbose>0)
@@ -102,43 +95,52 @@ int recover_xfs(disk_t *disk_car, const struct xfs_sb *sb,partition_t *partition
dump_log(sb,DEFAULT_SECTOR_SIZE);
}
}
-
+ set_xfs_info(sb, partition);
partition->part_size = (uint64_t)be64(sb->sb_dblocks) * be32(sb->sb_blocksize);
partition->part_type_i386=P_LINUX;
partition->part_type_mac=PMAC_LINUX;
partition->part_type_sun=PSUN_LINUX;
partition->part_type_gpt=GPT_ENT_TYPE_LINUX_DATA;
- set_xfs_info(sb, partition);
guid_cpy(&partition->part_uuid, (const efi_guid_t *)&sb->sb_uuid);
return 0;
}
-static int set_xfs_info(const struct xfs_sb *sb, partition_t *partition)
+static void set_xfs_info(const struct xfs_sb *sb, partition_t *partition)
{
partition->blocksize=be32(sb->sb_blocksize);
partition->fsname[0]='\0';
partition->info[0]='\0';
- switch(partition->upart_type)
+ switch(be16(sb->sb_versionnum) & XFS_SB_VERSION_NUMBITS)
{
- case UP_XFS:
+ case XFS_SB_VERSION_1:
+ partition->upart_type = UP_XFS;
+ snprintf(partition->info, sizeof(partition->info),
+ "XFS <=6.1, blocksize=%u", partition->blocksize);
+ break;
+ case XFS_SB_VERSION_2:
+ partition->upart_type = UP_XFS2;
snprintf(partition->info, sizeof(partition->info),
- "XFS <=6.1 blocksize=%u", partition->blocksize);
+ "XFS 6.2 - attributes, blocksize=%u", partition->blocksize);
break;
- case UP_XFS2:
+ case XFS_SB_VERSION_3:
+ partition->upart_type = UP_XFS3;
snprintf(partition->info, sizeof(partition->info),
- "XFS 6.2 - attributes blocksize=%u", partition->blocksize);
+ "XFS 6.2 - new inode version, blocksize=%u", partition->blocksize);
break;
- case UP_XFS3:
+ case XFS_SB_VERSION_4:
+ partition->upart_type = UP_XFS4;
snprintf(partition->info, sizeof(partition->info),
- "XFS 6.2 - new inode version blocksize=%u", partition->blocksize);
+ "XFS 6.2+ - bitmap version, blocksize=%u", partition->blocksize);
break;
- case UP_XFS4:
+ case XFS_SB_VERSION_5:
+ partition->upart_type = UP_XFS5;
snprintf(partition->info, sizeof(partition->info),
- "XFS 6.2+ - bitmap version blocksize=%u", partition->blocksize);
+ "XFS CRC enabled, blocksize=%u", partition->blocksize);
break;
default:
- return 1;
+ snprintf(partition->info, sizeof(partition->info),
+ "XFS unknown version %u\n", be16(sb->sb_versionnum)& XFS_SB_VERSION_NUMBITS);
+ break;
}
set_part_name(partition,sb->sb_fname,12);
- return 0;
}
diff --git a/src/xfs.h b/src/xfs.h
index 9f97236..2a6b511 100644
--- a/src/xfs.h
+++ b/src/xfs.h
@@ -38,6 +38,7 @@ extern "C" {
#define XFS_SB_VERSION_2 2 /* 6.2 - attributes */
#define XFS_SB_VERSION_3 3 /* 6.2 - new inode version */
#define XFS_SB_VERSION_4 4 /* 6.2+ - bitmask version */
+#define XFS_SB_VERSION_5 5 /* CRC enabled filesystem */
#define XFS_SB_VERSION_NUMBITS 0x000f
typedef uint32_t xfs_extlen_t; /* extent length in blocks */