diff options
| author | jnemeth <jnemeth@NetBSD.org> | 2019-06-21 02:14:59 +0000 |
|---|---|---|
| committer | jnemeth <jnemeth@NetBSD.org> | 2019-06-21 02:14:59 +0000 |
| commit | 56b3c1bedc13da0b4d7fc82c7ddea08bbd267357 (patch) | |
| tree | e18b052a398e025225ad9a61cdcccc205532d9b1 /sbin | |
| parent | f874bb57e2bbb9b79697f201993d8c23be73a76e (diff) | |
Add a third argument to the "cfn" function that is an argument to
gpt_change_ent(). The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry. It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.
This is in preparation for an upcoming change that will require it.
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/gpt/gpt.c | 8 | ||||
| -rw-r--r-- | sbin/gpt/gpt.h | 2 | ||||
| -rw-r--r-- | sbin/gpt/label.c | 4 | ||||
| -rw-r--r-- | sbin/gpt/remove.c | 4 | ||||
| -rw-r--r-- | sbin/gpt/type.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/sbin/gpt/gpt.c b/sbin/gpt/gpt.c index ca5cb17d559..565984faf64 100644 --- a/sbin/gpt/gpt.c +++ b/sbin/gpt/gpt.c @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: gpt.c,v 1.78 2019/06/20 10:41:58 martin Exp $"); +__RCSID("$NetBSD: gpt.c,v 1.79 2019/06/21 02:14:59 jnemeth Exp $"); #endif #include <sys/param.h> @@ -1015,7 +1015,7 @@ gpt_add_find(gpt_t gpt, struct gpt_find *find, int ch) int gpt_change_ent(gpt_t gpt, const struct gpt_find *find, - void (*cfn)(struct gpt_ent *, void *), void *v) + void (*cfn)(struct gpt_ent *, void *, int), void *v) { map_t m; struct gpt_hdr *hdr; @@ -1058,14 +1058,14 @@ gpt_change_ent(gpt_t gpt, const struct gpt_find *find, continue; /* Change the primary entry. */ - (*cfn)(ent, v); + (*cfn)(ent, v, 0); if (gpt_write_primary(gpt) == -1) return -1; ent = gpt_ent_backup(gpt, i); /* Change the secondary entry. */ - (*cfn)(ent, v); + (*cfn)(ent, v, 1); if (gpt_write_backup(gpt) == -1) return -1; diff --git a/sbin/gpt/gpt.h b/sbin/gpt/gpt.h index 05a7bed28d6..92b99b8d02a 100644 --- a/sbin/gpt/gpt.h +++ b/sbin/gpt/gpt.h @@ -115,7 +115,7 @@ struct gpt_find { const char *msg; }; int gpt_change_ent(gpt_t, const struct gpt_find *, - void (*)(struct gpt_ent *, void *), void *); + void (*)(struct gpt_ent *, void *, int), void *); int gpt_add_find(gpt_t, struct gpt_find *, int); #define GPT_AIS "a:i:s:" diff --git a/sbin/gpt/label.c b/sbin/gpt/label.c index 3255ef85890..ea9b139113a 100644 --- a/sbin/gpt/label.c +++ b/sbin/gpt/label.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/label.c,v 1.3 2006/10/04 18:20:25 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: label.c,v 1.29 2018/07/03 03:41:24 jnemeth Exp $"); +__RCSID("$NetBSD: label.c,v 1.30 2019/06/21 02:14:59 jnemeth Exp $"); #endif #include <sys/types.h> @@ -68,7 +68,7 @@ struct gpt_cmd c_label = { #define usage() gpt_usage(NULL, &c_label) static void -change(struct gpt_ent *ent, void *v) +change(struct gpt_ent *ent, void *v, int backup) { uint8_t *name = v; utf8_to_utf16(name, ent->ent_name, __arraycount(ent->ent_name)); diff --git a/sbin/gpt/remove.c b/sbin/gpt/remove.c index c96e744b5d5..d65a8ba4659 100644 --- a/sbin/gpt/remove.c +++ b/sbin/gpt/remove.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: remove.c,v 1.22 2018/07/03 03:41:24 jnemeth Exp $"); +__RCSID("$NetBSD: remove.c,v 1.23 2019/06/21 02:14:59 jnemeth Exp $"); #endif #include <sys/types.h> @@ -66,7 +66,7 @@ struct gpt_cmd c_remove = { #define usage() gpt_usage(NULL, &c_remove) static void -change(struct gpt_ent *ent, void *v) +change(struct gpt_ent *ent, void *v, int backup) { /* Remove the primary entry by clearing the partition type. */ gpt_uuid_copy(ent->ent_type, gpt_uuid_nil); diff --git a/sbin/gpt/type.c b/sbin/gpt/type.c index 9d632c8a29f..1c218b2eca0 100644 --- a/sbin/gpt/type.c +++ b/sbin/gpt/type.c @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $"); #endif #ifdef __RCSID -__RCSID("$NetBSD: type.c,v 1.15 2018/07/03 03:41:24 jnemeth Exp $"); +__RCSID("$NetBSD: type.c,v 1.16 2019/06/21 02:14:59 jnemeth Exp $"); #endif #include <sys/types.h> @@ -67,7 +67,7 @@ struct gpt_cmd c_type = { #define usage() gpt_usage(NULL, &c_type) static void -change(struct gpt_ent *ent, void *v) +change(struct gpt_ent *ent, void *v, int backup) { gpt_uuid_t *newtype = v; gpt_uuid_copy(ent->ent_type, *newtype); |
