diff options
-rw-r--r-- | sbin/pdisk/dump.c | 6 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.c | 7 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.h | 3 | ||||
-rw-r--r-- | sbin/pdisk/pdisk.c | 6 |
4 files changed, 9 insertions, 13 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index a8ced2c7135..0a709676392 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.73 2016/01/31 22:52:57 krw Exp $ */ +/* $OpenBSD: dump.c,v 1.74 2016/01/31 23:00:11 krw Exp $ */ /* * dump.c - dumping partition maps @@ -81,7 +81,7 @@ dump_partition_map(struct partition_map *map) int digits, max_type_length, max_name_length; printf("\nPartition map (with %d byte blocks) on '%s'\n", - map->physical_block, map->name); + map->sbBlkSize, map->name); digits = number_of_digits(get_max_base_or_length(map)); if (digits < 6) @@ -135,7 +135,7 @@ show_data_structures(struct partition_map *map) printf("Header:\n"); printf("map %d blocks out of %d, media %lu blocks (%d byte blocks)\n", map->blocks_in_map, map->maximum_in_map, map->media_size, - map->physical_block); + map->sbBlkSize); printf("Map is%s writable", rflag ? " not" : ""); printf(" and has%s been changed\n", (map->changed) ? "" : " not"); printf("\n"); diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c index 000fb32dcb1..9afae98c48e 100644 --- a/sbin/pdisk/partition_map.c +++ b/sbin/pdisk/partition_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.c,v 1.96 2016/01/31 22:26:52 krw Exp $ */ +/* $OpenBSD: partition_map.c,v 1.97 2016/01/31 23:00:11 krw Exp $ */ /* * partition_map.c - partition map routines @@ -72,7 +72,6 @@ open_partition_map(int fd, char *name, uint64_t mediasz, uint32_t sectorsz) map->changed = 0; LIST_INIT(&map->disk_order); LIST_INIT(&map->base_order); - map->physical_block = sectorsz; map->blocks_in_map = 0; map->maximum_in_map = -1; @@ -272,14 +271,12 @@ create_partition_map(int fd, char *name, u_int64_t mediasz, uint32_t sectorsz) LIST_INIT(&map->disk_order); LIST_INIT(&map->base_order); - map->physical_block = sectorsz; - map->blocks_in_map = 0; map->maximum_in_map = -1; map->media_size = mediasz; map->sbSig = BLOCK0_SIGNATURE; - map->sbBlkSize = map->physical_block; + map->sbBlkSize = sectorsz; map->sbBlkCount = map->media_size; entry = create_entry(map, 1, "", kFreeType, 1, mediasz - 1); diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h index 86aa7cea8cb..ad1e0d23931 100644 --- a/sbin/pdisk/partition_map.h +++ b/sbin/pdisk/partition_map.h @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.h,v 1.41 2016/01/31 15:28:56 krw Exp $ */ +/* $OpenBSD: partition_map.h,v 1.42 2016/01/31 23:00:11 krw Exp $ */ /* * partition_map.h - partition map routines @@ -49,7 +49,6 @@ struct partition_map { char *name; int fd; int changed; - int physical_block; int blocks_in_map; int maximum_in_map; unsigned long media_size; /* in physical blocks */ diff --git a/sbin/pdisk/pdisk.c b/sbin/pdisk/pdisk.c index c43ace926a1..17377541d8f 100644 --- a/sbin/pdisk/pdisk.c +++ b/sbin/pdisk/pdisk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pdisk.c,v 1.82 2016/01/30 17:21:10 krw Exp $ */ +/* $OpenBSD: pdisk.c,v 1.83 2016/01/31 23:00:11 krw Exp $ */ /* * pdisk - an editor for Apple format partition tables @@ -193,7 +193,7 @@ edit(struct partition_map **mapp) oldmap = map; map = create_partition_map(oldmap->fd, oldmap->name, oldmap->media_size, - oldmap->physical_block); + oldmap->sbBlkSize); if (map == NULL) break; *mapp = map; @@ -313,7 +313,7 @@ get_size_argument(long *number, struct partition_map *map) if (get_number_argument("Length in blocks: ", number) == 0) { bad_input("Bad length"); } else { - multiple = get_multiplier(map->physical_block); + multiple = get_multiplier(map->sbBlkSize); if (multiple == 0) { bad_input("Bad multiplier"); } else if (multiple != 1) { |