summaryrefslogtreecommitdiff
path: root/sbin/pdisk
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-28 13:09:22 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-28 13:09:22 +0000
commit9286ea2ea672c0fe6d98ec2b29a2122934d7c6fb (patch)
tree4bad1070e1c8bdd6ebb6c70042e68c0fcfa0b062 /sbin/pdisk
parent853752fdb3c0f56c35adc7b0caaa751f8a1ee7a2 (diff)
Since we don't allow maps to be created or opened with an invalid
block0, there is no point in checking later if block0 has magically become invalid.
Diffstat (limited to 'sbin/pdisk')
-rw-r--r--sbin/pdisk/dump.c8
-rw-r--r--sbin/pdisk/partition_map.c14
2 files changed, 5 insertions, 17 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index 8085890fe32..f0dc022b175 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.60 2016/01/27 20:34:27 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.61 2016/01/28 13:09:21 krw Exp $ */
/*
* dump.c - dumping partition maps
@@ -52,8 +52,6 @@ dump_block_zero(struct partition_map_header *map)
int i, prefix;
p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return;
value = ((double) p->sbBlkCount) * p->sbBlkSize;
adjust_value_and_compute_prefix(&value, &prefix);
@@ -165,10 +163,6 @@ show_data_structures(struct partition_map_header *map)
printf("Block0:\n");
printf("signature 0x%x", zp->sbSig);
- if (zp->sbSig == BLOCK0_SIGNATURE)
- printf("\n");
- else
- printf(" should be 0x%x\n", BLOCK0_SIGNATURE);
printf("Block size=%u, Number of Blocks=%u\n", zp->sbBlkSize,
zp->sbBlkCount);
printf("DeviceType=0x%x, DeviceId=0x%x, sbData=0x%x\n", zp->sbDevType,
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index 877a754754c..33dee16d4da 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.74 2016/01/28 13:01:33 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.75 2016/01/28 13:09:21 krw Exp $ */
/*
* partition_map.c - partition map routines
@@ -620,8 +620,6 @@ contains_driver(struct partition_map *entry)
map = entry->the_map;
p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return 0;
if (p->sbDrvrCount > 0) {
m = p->sbDDMap;
@@ -966,16 +964,12 @@ doit:
void
remove_driver(struct partition_map *entry)
{
- struct partition_map_header *map;
- struct block0 *p;
- struct ddmap *m;
+ struct block0 *p;
+ struct ddmap *m;
int i, j;
uint32_t start;
- map = entry->the_map;
- p = map->block0;
- if (p->sbSig != BLOCK0_SIGNATURE)
- return;
+ p = entry->the_map->block0;
/*
* compute the factor to convert the block numbers in block0