summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-01-29 14:48:21 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-01-29 14:48:21 +0000
commite1c7a3f28cda3c551375d51c48968c15f969e58b (patch)
tree02cbffe321065ca2465ae018eea4341813f1ce15 /sbin
parent9169903a1aca691234b7d63f8d2bd4245bd3f6b8 (diff)
Rename struct partition_map to struct entry. No change to .o files.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/pdisk/dump.c18
-rw-r--r--sbin/pdisk/partition_map.c66
-rw-r--r--sbin/pdisk/partition_map.h38
3 files changed, 61 insertions, 61 deletions
diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c
index 5d0246f679d..1292068f4c7 100644
--- a/sbin/pdisk/dump.c
+++ b/sbin/pdisk/dump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dump.c,v 1.62 2016/01/28 19:07:45 krw Exp $ */
+/* $OpenBSD: dump.c,v 1.63 2016/01/29 14:48:20 krw Exp $ */
/*
* dump.c - dumping partition maps
@@ -40,7 +40,7 @@
void adjust_value_and_compute_prefix(double *, int *);
void dump_block_zero(struct partition_map_header *);
-void dump_partition_entry(struct partition_map *, int, int, int);
+void dump_partition_entry(struct entry *, int, int, int);
int get_max_base_or_length(struct partition_map_header *);
int get_max_name_string_length(struct partition_map_header *);
int get_max_type_string_length(struct partition_map_header *);
@@ -77,7 +77,7 @@ dump_block_zero(struct partition_map_header *map)
void
dump_partition_map(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
int digits, max_type_length, max_name_length;
printf("\nPartition map (with %d byte blocks) on '%s'\n",
@@ -104,7 +104,7 @@ dump_partition_map(struct partition_map_header *map)
void
-dump_partition_entry(struct partition_map *entry, int type_length,
+dump_partition_entry(struct entry *entry, int type_length,
int name_length, int digits)
{
struct partition_map_header *map;
@@ -146,7 +146,7 @@ dump_partition_entry(struct partition_map *entry, int type_length,
void
show_data_structures(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
struct block0 *zp;
struct ddmap *m;
struct dpme *p;
@@ -224,7 +224,7 @@ show_data_structures(struct partition_map_header *map)
void
full_dump_partition_entry(struct partition_map_header *map, int ix)
{
- struct partition_map *cur;
+ struct entry *cur;
struct dpme *p;
int i;
uint32_t t;
@@ -357,7 +357,7 @@ full_dump_block_zero(struct partition_map_header *map)
int
get_max_type_string_length(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
int max, length;
max = 0;
@@ -374,7 +374,7 @@ get_max_type_string_length(struct partition_map_header *map)
int
get_max_name_string_length(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
int max, length;
max = 0;
@@ -391,7 +391,7 @@ get_max_name_string_length(struct partition_map_header *map)
int
get_max_base_or_length(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
int max;
max = 0;
diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c
index 0409a1bab5e..a167e49c08b 100644
--- a/sbin/pdisk/partition_map.c
+++ b/sbin/pdisk/partition_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.c,v 1.82 2016/01/29 14:26:42 krw Exp $ */
+/* $OpenBSD: partition_map.c,v 1.83 2016/01/29 14:48:20 krw Exp $ */
/*
* partition_map.c - partition map routines
@@ -56,14 +56,14 @@ enum add_action {
int add_data_to_map(struct dpme *, long,
struct partition_map_header *);
int coerce_block0(struct partition_map_header *);
-int contains_driver(struct partition_map *);
-void combine_entry(struct partition_map *);
+int contains_driver(struct entry *);
+void combine_entry(struct entry *);
struct dpme *create_dpme(const char *, const char *, uint32_t, uint32_t);
-void delete_entry(struct partition_map *);
-void insert_in_base_order(struct partition_map *);
-void insert_in_disk_order(struct partition_map *);
+void delete_entry(struct entry *);
+void insert_in_base_order(struct entry *);
+void insert_in_disk_order(struct entry *);
int read_partition_map(struct partition_map_header *);
-void remove_driver(struct partition_map *);
+void remove_driver(struct entry *);
void renumber_disk_addresses(struct partition_map_header *);
struct partition_map_header *
@@ -144,7 +144,7 @@ open_partition_map(int fd, char *name, uint64_t mediasz, uint32_t sectorsz)
void
free_partition_map(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
if (map) {
free(map->block0);
@@ -161,7 +161,7 @@ free_partition_map(struct partition_map_header *map)
int
read_partition_map(struct partition_map_header *map)
{
- struct partition_map *cur, *nextcur;
+ struct entry *cur, *nextcur;
struct dpme *dpme;
int ix;
uint32_t limit, base, next, nextbase;
@@ -243,7 +243,7 @@ read_partition_map(struct partition_map_header *map)
void
write_partition_map(struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
int result;
result = write_block0(map->fd, map->block0);
@@ -261,9 +261,9 @@ write_partition_map(struct partition_map_header *map)
int
add_data_to_map(struct dpme *dpme, long ix, struct partition_map_header *map)
{
- struct partition_map *entry;
+ struct entry *entry;
- entry = malloc(sizeof(struct partition_map));
+ entry = malloc(sizeof(struct entry));
if (entry == NULL) {
warn("can't allocate memory for map entries");
return 0;
@@ -363,7 +363,7 @@ int
add_partition_to_map(const char *name, const char *dptype, uint32_t base,
uint32_t length, struct partition_map_header *map)
{
- struct partition_map *cur;
+ struct entry *cur;
struct dpme *dpme;
enum add_action act;
int limit;
@@ -496,7 +496,7 @@ dpme_init_flags(struct dpme *dpme)
void
renumber_disk_addresses(struct partition_map_header *map)
{
- struct partition_map *cur;
+ struct entry *cur;
long ix;
/* reset disk addresses */
@@ -508,7 +508,7 @@ renumber_disk_addresses(struct partition_map_header *map)
}
void
-delete_partition_from_map(struct partition_map *entry)
+delete_partition_from_map(struct entry *entry)
{
struct dpme *dpme;
@@ -542,7 +542,7 @@ delete_partition_from_map(struct partition_map *entry)
int
-contains_driver(struct partition_map *entry)
+contains_driver(struct entry *entry)
{
struct partition_map_header *map;
struct block0 *p;
@@ -569,9 +569,9 @@ contains_driver(struct partition_map *entry)
void
-combine_entry(struct partition_map *entry)
+combine_entry(struct entry *entry)
{
- struct partition_map *p;
+ struct entry *p;
uint32_t end;
if (entry == NULL ||
@@ -645,7 +645,7 @@ combine_entry(struct partition_map *entry)
void
-delete_entry(struct partition_map *entry)
+delete_entry(struct entry *entry)
{
struct partition_map_header *map;
@@ -660,10 +660,10 @@ delete_entry(struct partition_map *entry)
}
-struct partition_map *
+struct entry *
find_entry_by_disk_address(long ix, struct partition_map_header *map)
{
- struct partition_map *cur;
+ struct entry *cur;
LIST_FOREACH(cur, &map->disk_order, disk_entry) {
if (cur->disk_address == ix)
@@ -673,10 +673,10 @@ find_entry_by_disk_address(long ix, struct partition_map_header *map)
}
-struct partition_map *
+struct entry *
find_entry_by_type(const char *type_name, struct partition_map_header *map)
{
- struct partition_map *cur;
+ struct entry *cur;
LIST_FOREACH(cur, &map->base_order, base_entry) {
if (strncasecmp(cur->dpme->dpme_type, type_name, DPISTRLEN) ==
@@ -686,10 +686,10 @@ find_entry_by_type(const char *type_name, struct partition_map_header *map)
return cur;
}
-struct partition_map *
+struct entry *
find_entry_by_base(uint32_t base, struct partition_map_header *map)
{
- struct partition_map *cur;
+ struct entry *cur;
LIST_FOREACH(cur, &map->base_order, base_entry) {
if (cur->dpme->dpme_pblock_start == base)
@@ -702,7 +702,7 @@ find_entry_by_base(uint32_t base, struct partition_map_header *map)
void
move_entry_in_map(long index1, long index2, struct partition_map_header *map)
{
- struct partition_map *p1, *p2;
+ struct entry *p1, *p2;
if (index1 == index2)
return;
@@ -737,10 +737,10 @@ move_entry_in_map(long index1, long index2, struct partition_map_header *map)
void
-insert_in_disk_order(struct partition_map *entry)
+insert_in_disk_order(struct entry *entry)
{
struct partition_map_header *map;
- struct partition_map *cur;
+ struct entry *cur;
/* find position in disk list & insert */
map = entry->the_map;
@@ -763,10 +763,10 @@ insert_in_disk_order(struct partition_map *entry)
void
-insert_in_base_order(struct partition_map *entry)
+insert_in_base_order(struct entry *entry)
{
struct partition_map_header *map;
- struct partition_map *cur;
+ struct entry *cur;
uint32_t start;
/* find position in base list & insert */
@@ -793,8 +793,8 @@ insert_in_base_order(struct partition_map *entry)
void
resize_map(long new_size, struct partition_map_header *map)
{
- struct partition_map *entry;
- struct partition_map *next;
+ struct entry *entry;
+ struct entry *next;
int incr;
entry = find_entry_by_type(kMapType, map);
@@ -846,7 +846,7 @@ doit:
void
-remove_driver(struct partition_map *entry)
+remove_driver(struct entry *entry)
{
struct block0 *p;
struct ddmap *m;
diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h
index 49960fe9c91..471bbe8394e 100644
--- a/sbin/pdisk/partition_map.h
+++ b/sbin/pdisk/partition_map.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: partition_map.h,v 1.32 2016/01/28 22:09:56 krw Exp $ */
+/* $OpenBSD: partition_map.h,v 1.33 2016/01/29 14:48:20 krw Exp $ */
/*
* partition_map.h - partition map routines
@@ -30,24 +30,24 @@
#ifndef __partition_map__
#define __partition_map__
-struct partition_map;
+struct entry;
struct partition_map_header {
- LIST_HEAD(, partition_map) disk_order;
- LIST_HEAD(, partition_map) base_order;
- char *name;
- struct block0 *block0;
- int fd;
- int changed;
- int physical_block;
- int blocks_in_map;
- int maximum_in_map;
- unsigned long media_size; /* in physical blocks */
+ LIST_HEAD(, entry) disk_order;
+ LIST_HEAD(, entry) base_order;
+ char *name;
+ struct block0 *block0;
+ int fd;
+ int changed;
+ int physical_block;
+ int blocks_in_map;
+ int maximum_in_map;
+ unsigned long media_size; /* in physical blocks */
};
-struct partition_map {
- LIST_ENTRY(partition_map) disk_entry;
- LIST_ENTRY(partition_map) base_entry;
+struct entry {
+ LIST_ENTRY(entry) disk_entry;
+ LIST_ENTRY(entry) base_entry;
struct partition_map_header *the_map;
struct dpme *dpme;
long disk_address;
@@ -71,17 +71,17 @@ struct partition_map_header *create_partition_map(int, char *, uint64_t,
struct partition_map_header *open_partition_map(int, char *, uint64_t,
uint32_t);
-struct partition_map *find_entry_by_disk_address(long,
+struct entry *find_entry_by_disk_address(long,
struct partition_map_header *);
-struct partition_map *find_entry_by_type(const char *,
+struct entry *find_entry_by_type(const char *,
struct partition_map_header *);
-struct partition_map *find_entry_by_base(uint32_t,
+struct entry *find_entry_by_base(uint32_t,
struct partition_map_header *);
int add_partition_to_map(const char *, const char *, uint32_t, uint32_t,
struct partition_map_header *);
void free_partition_map(struct partition_map_header *);
-void delete_partition_from_map(struct partition_map *);
+void delete_partition_from_map(struct entry *);
void move_entry_in_map(long, long, struct partition_map_header *);
void resize_map(long new_size, struct partition_map_header *);
void write_partition_map(struct partition_map_header *);