summaryrefslogtreecommitdiffstats
path: root/src/lvm.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:16:20 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:16:20 +0100
commit286e35eee96bec50112bb1d5098e8cb6596c1ef7 (patch)
treeb795cfd729909a8942364d8929e4804bdfde51c7 /src/lvm.c
parentcb74f4e9f11ba6b4b46c5cf68913a7ffd3f55c35 (diff)
New prototype for test_LVM2()
Diffstat (limited to 'src/lvm.c')
-rw-r--r--src/lvm.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lvm.c b/src/lvm.c
index 526baf6..f8375d6 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -37,11 +37,11 @@
#include "log.h"
#include "guid_cpy.h"
-static int set_LVM_info(partition_t *partition);
-static int test_LVM(disk_t *disk_car, const pv_disk_t *pv,partition_t *partition,const int verbose, const int dump_ind);
+static void set_LVM_info(partition_t *partition);
+static int test_LVM(disk_t *disk_car, const pv_disk_t *pv, const partition_t *partition,const int verbose, const int dump_ind);
-static int set_LVM2_info(partition_t*partition);
-static int test_LVM2(disk_t *disk_car, const struct lvm2_label_header *lh,partition_t *partition,const int verbose, const int dump_ind);
+static void set_LVM2_info(partition_t*partition);
+static int test_LVM2(disk_t *disk_car, const struct lvm2_label_header *lh, const partition_t *partition, const int verbose, const int dump_ind);
int check_LVM(disk_t *disk_car,partition_t *partition,const int verbose)
{
@@ -79,7 +79,7 @@ int recover_LVM(disk_t *disk_car, const pv_disk_t *pv,partition_t *partition,con
return 0;
}
-static int test_LVM(disk_t *disk_car, const pv_disk_t *pv,partition_t *partition,const int verbose, const int dump_ind)
+static int test_LVM(disk_t *disk_car, const pv_disk_t *pv, const partition_t *partition, const int verbose, const int dump_ind)
{
if ((memcmp((const char *)pv->id,LVM_ID,sizeof(pv->id)) == 0) && (le16(pv->version) == 1 || le16(pv->version) == 2))
{
@@ -113,18 +113,17 @@ static int test_LVM(disk_t *disk_car, const pv_disk_t *pv,partition_t *partition
return (1);
if (le32(pv->pe_allocated) > le32(pv->pe_total))
return (1);
- partition->upart_type=UP_LVM;
return 0;
}
return 1;
}
-static int set_LVM_info(partition_t *partition)
+static void set_LVM_info(partition_t *partition)
{
+ partition->upart_type=UP_LVM;
partition->fsname[0]='\0';
partition->info[0]='\0';
snprintf(partition->info,sizeof(partition->info),"LVM");
- return 0;
}
int check_LVM2(disk_t *disk_car,partition_t *partition,const int verbose)
@@ -166,7 +165,7 @@ int recover_LVM2(disk_t *disk_car, const unsigned char *buf,partition_t *partiti
return 0;
}
-static int test_LVM2(disk_t *disk_car, const struct lvm2_label_header *lh,partition_t *partition,const int verbose, const int dump_ind)
+static int test_LVM2(disk_t *disk_car, const struct lvm2_label_header *lh, const partition_t *partition, const int verbose, const int dump_ind)
{
if (memcmp((const char *)lh->type,LVM2_LABEL,sizeof(lh->type)) == 0)
{
@@ -181,16 +180,15 @@ static int test_LVM2(disk_t *disk_car, const struct lvm2_label_header *lh,partit
/* There is a little offset ... */
dump_log(lh,DEFAULT_SECTOR_SIZE);
}
- partition->upart_type=UP_LVM2;
return 0;
}
return 1;
}
-static int set_LVM2_info(partition_t*partition)
+static void set_LVM2_info(partition_t*partition)
{
+ partition->upart_type=UP_LVM2;
partition->fsname[0]='\0';
partition->info[0]='\0';
snprintf(partition->info,sizeof(partition->info),"LVM2");
- return 0;
}