From 373a7ce36d46ca14cfa982fba66531cb1660c646 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 23 Jan 2016 09:42:39 +0100 Subject: [PATCH] New prototype for test_btrfs() --- src/btrfs.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/btrfs.c b/src/btrfs.c index 79b6117e..062b52eb 100644 --- a/src/btrfs.c +++ b/src/btrfs.c @@ -37,10 +37,11 @@ #include "log.h" #include "guid_cpy.h" -static int test_btrfs(const struct btrfs_super_block *sb, partition_t *partition); +static int test_btrfs(const struct btrfs_super_block *sb); -static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition) +static void set_btrfs_info(const struct btrfs_super_block *sb, partition_t *partition) { + partition->upart_type=UP_BTRFS; partition->blocksize=le32(sb->dev_item.sector_size); set_part_name(partition, sb->label, sizeof(sb->label)); snprintf(partition->info, sizeof(partition->info), "btrfs blocksize=%u", partition->blocksize); @@ -49,7 +50,6 @@ static int set_btrfs_info(const struct btrfs_super_block *sb, partition_t *parti strcat(partition->info," Backup superblock"); } /* last mounted => date */ - return 0; } int check_btrfs(disk_t *disk_car,partition_t *partition) @@ -60,7 +60,7 @@ int check_btrfs(disk_t *disk_car,partition_t *partition) free(buffer); return 1; } - if(test_btrfs((struct btrfs_super_block*)buffer, partition)!=0) + if(test_btrfs((struct btrfs_super_block*)buffer)!=0) { free(buffer); return 1; @@ -76,7 +76,7 @@ Group 0 begin at s_first_data_block */ int recover_btrfs(disk_t *disk, const struct btrfs_super_block *sb, partition_t *partition, const int verbose, const int dump_ind) { - if(test_btrfs(sb, partition)!=0) + if(test_btrfs(sb)!=0) return 1; if(dump_ind!=0) { @@ -112,12 +112,11 @@ int recover_btrfs(disk_t *disk, const struct btrfs_super_block *sb, partition_t return 0; } -static int test_btrfs(const struct btrfs_super_block *sb, partition_t *partition) +static int test_btrfs(const struct btrfs_super_block *sb) { if(memcmp(&sb->magic, BTRFS_MAGIC, 8)!=0) return 1; if(le32(sb->dev_item.sector_size)==0) return 1; - partition->upart_type=UP_BTRFS; return 0; }