Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/gpt remove compat defines.



details:   https://anonhg.NetBSD.org/src/rev/c3b4adb3d00d
branches:  trunk
changeset: 332588:c3b4adb3d00d
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 30 02:12:55 2014 +0000

description:
remove compat defines.

diffstat:

 sbin/gpt/add.c        |  10 +++++-----
 sbin/gpt/backup.c     |   8 ++++----
 sbin/gpt/create.c     |   8 ++++----
 sbin/gpt/gpt.c        |   4 ++--
 sbin/gpt/gpt.h        |   5 -----
 sbin/gpt/label.c      |   4 ++--
 sbin/gpt/migrate.c    |  32 ++++++++++++++++----------------
 sbin/gpt/remove.c     |   8 ++++----
 sbin/gpt/resize.c     |   4 ++--
 sbin/gpt/resizedisk.c |   4 ++--
 sbin/gpt/restore.c    |   8 ++++----
 sbin/gpt/set.c        |   4 ++--
 sbin/gpt/show.c       |  10 +++++-----
 sbin/gpt/type.c       |   8 ++++----
 sbin/gpt/unset.c      |   4 ++--
 15 files changed, 58 insertions(+), 63 deletions(-)

diffs (truncated from 563 to 300 lines):

diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/add.c
--- a/sbin/gpt/add.c    Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/add.c    Tue Sep 30 02:12:55 2014 +0000
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: add.c,v 1.25 2014/09/29 20:28:57 christos Exp $");
+__RCSID("$NetBSD: add.c,v 1.26 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -114,7 +114,7 @@
                i = entry - 1;
                ent = (void*)((char*)tbl->map_data + i *
                    le32toh(hdr->hdr_entsz));
-               le_uuid_dec(ent->ent_type, &uuid);
+               uuid_dec_le(ent->ent_type, &uuid);
                if (!uuid_is_nil(&uuid, NULL)) {
                        warnx("%s: error: entry at index %u is not free",
                            device_name, entry);
@@ -125,7 +125,7 @@
                for (i = 0; i < le32toh(hdr->hdr_entries); i++) {
                        ent = (void*)((char*)tbl->map_data + i *
                            le32toh(hdr->hdr_entsz));
-                       le_uuid_dec(ent->ent_type, &uuid);
+                       uuid_dec_le(ent->ent_type, &uuid);
                        if (uuid_is_nil(&uuid, NULL))
                                break;
                }
@@ -153,7 +153,7 @@
                }
        }
 
-       le_uuid_enc(ent->ent_type, &type);
+       uuid_enc_le(ent->ent_type, &type);
        ent->ent_lba_start = htole64(map->map_start);
        ent->ent_lba_end = htole64(map->map_start + map->map_size - 1LL);
        if (name != NULL)
@@ -170,7 +170,7 @@
        hdr = tpg->map_data;
        ent = (void*)((char*)lbt->map_data + i * le32toh(hdr->hdr_entsz));
 
-       le_uuid_enc(ent->ent_type, &type);
+       uuid_enc_le(ent->ent_type, &type);
        ent->ent_lba_start = htole64(map->map_start);
        ent->ent_lba_end = htole64(map->map_start + map->map_size - 1LL);
        if (name != NULL)
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/backup.c
--- a/sbin/gpt/backup.c Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/backup.c Tue Sep 30 02:12:55 2014 +0000
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: backup.c,v 1.6 2014/09/29 22:22:03 christos Exp $");
+__RCSID("$NetBSD: backup.c,v 1.7 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/bootblock.h>
@@ -201,7 +201,7 @@
                        rc = prop_dictionary_set(type_dict, "revision",
                            propnum);
                        PROP_ERR(rc);
-                       le_uuid_dec(hdr->hdr_guid, &u);
+                       uuid_dec_le(hdr->hdr_guid, &u);
                        uuid_to_string(&u, &s, NULL);
                        propstr = prop_string_create_cstring(s);
                        free(s);
@@ -232,14 +232,14 @@
                                rc = prop_dictionary_set(gpt_dict, "index",
                                    propnum);
                                PROP_ERR(propnum);
-                               le_uuid_dec(ent->ent_type, &u);
+                               uuid_dec_le(ent->ent_type, &u);
                                uuid_to_string(&u, &s, NULL);
                                propstr = prop_string_create_cstring(s);
                                free(s);
                                PROP_ERR(propstr);
                                rc = prop_dictionary_set(gpt_dict, "type",
                                    propstr);
-                               le_uuid_dec(ent->ent_guid, &u);
+                               uuid_dec_le(ent->ent_guid, &u);
                                uuid_to_string(&u, &s, NULL);
                                propstr = prop_string_create_cstring(s);
                                free(s);
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/create.c
--- a/sbin/gpt/create.c Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/create.c Tue Sep 30 02:12:55 2014 +0000
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: create.c,v 1.8 2014/09/29 20:28:57 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.9 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -170,13 +170,13 @@
        hdr = gpt->map_data;
        memcpy(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig));
        hdr->hdr_revision = htole32(GPT_HDR_REVISION);
-       hdr->hdr_size = htole32(GPT_SIZE);
+       hdr->hdr_size = htole32(GPT_HDR_SIZE);
        hdr->hdr_lba_self = htole64(gpt->map_start);
        hdr->hdr_lba_alt = htole64(last);
        hdr->hdr_lba_start = htole64(tbl->map_start + blocks);
        hdr->hdr_lba_end = htole64(last - blocks - 1LL);
        uuid_create(&uuid, NULL);
-       le_uuid_enc(hdr->hdr_uuid, &uuid);
+       uuid_enc_le(hdr->hdr_guid, &uuid);
        hdr->hdr_lba_table = htole64(tbl->map_start);
        hdr->hdr_entries = htole32((blocks * secsz) / sizeof(struct gpt_ent));
        if (le32toh(hdr->hdr_entries) > parts)
@@ -186,7 +186,7 @@
        ent = tbl->map_data;
        for (i = 0; i < le32toh(hdr->hdr_entries); i++) {
                uuid_create(&uuid, NULL);
-               le_uuid_enc(ent[i].ent_uuid, &uuid);
+               uuid_enc_le(ent[i].ent_guid, &uuid);
        }
 
        hdr->hdr_crc_table = htole32(crc32(ent, le32toh(hdr->hdr_entries) *
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/gpt.c
--- a/sbin/gpt/gpt.c    Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/gpt.c    Tue Sep 30 02:12:55 2014 +0000
@@ -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.32 2014/09/29 21:04:34 christos Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.33 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/param.h>
@@ -622,7 +622,7 @@
                size = le64toh(ent->ent_lba_end) - le64toh(ent->ent_lba_start) +
                    1LL;
                if (verbose > 2) {
-                       le_uuid_dec(&ent->ent_type, &type);
+                       uuid_dec_le(&ent->ent_type, &type);
                        uuid_to_string(&type, &s, NULL);
                        warnx(
        "%s: GPT partition: type=%s, start=%llu, size=%llu", device_name, s,
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/gpt.h
--- a/sbin/gpt/gpt.h    Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/gpt.h    Tue Sep 30 02:12:55 2014 +0000
@@ -35,14 +35,9 @@
 #else
 #include <nbinclude/sys/disklabel_gpt.h>
 #endif
-#define GPT_SIZE GPT_HDR_SIZE
-#define hdr_uuid hdr_guid
-#define ent_uuid ent_guid
 
 #include <uuid.h>
 
-#define le_uuid_dec uuid_dec_le
-#define le_uuid_enc uuid_enc_le
 int    parse_uuid(const char *, uuid_t *);
 
 struct mbr_part {
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/label.c
--- a/sbin/gpt/label.c  Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/label.c  Tue Sep 30 02:12:55 2014 +0000
@@ -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.16 2014/09/29 20:28:57 christos Exp $");
+__RCSID("$NetBSD: label.c,v 1.17 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -124,7 +124,7 @@
                            (char *)utf16_to_utf8(ent->ent_name)) != 0)
                                continue;
 
-               le_uuid_dec(ent->ent_type, &uuid);
+               uuid_dec_le(ent->ent_type, &uuid);
                if (!uuid_is_nil(&type, NULL) &&
                    !uuid_equal(&type, &uuid, NULL))
                        continue;
diff -r d6fc3722723b -r c3b4adb3d00d sbin/gpt/migrate.c
--- a/sbin/gpt/migrate.c        Tue Sep 30 00:06:19 2014 +0000
+++ b/sbin/gpt/migrate.c        Tue Sep 30 02:12:55 2014 +0000
@@ -33,7 +33,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: migrate.c,v 1.17 2014/09/29 22:22:03 christos Exp $");
+__RCSID("$NetBSD: migrate.c,v 1.18 2014/09/30 02:12:55 christos Exp $");
 #endif
 
 #include <sys/types.h>
@@ -126,28 +126,28 @@
                        continue;
                case FS_SWAP: {
                        static const uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP;
-                       le_uuid_enc(ent->ent_type, &swap);
+                       uuid_enc_le(ent->ent_type, &swap);
                        utf8_to_utf16((const uint8_t *)"FreeBSD swap partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_BSDFFS: {
                        static const uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS;
-                       le_uuid_enc(ent->ent_type, &ufs);
+                       uuid_enc_le(ent->ent_type, &ufs);
                        utf8_to_utf16((const uint8_t *)"FreeBSD UFS partition",
                            ent->ent_name, 36);
                        break;
                }
                case FREEBSD_FS_VINUM: {
                        static const uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
-                       le_uuid_enc(ent->ent_type, &vinum);
+                       uuid_enc_le(ent->ent_type, &vinum);
                        utf8_to_utf16((const uint8_t *)"FreeBSD vinum partition",
                            ent->ent_name, 36);
                        break;
                }
                case FREEBSD_FS_ZFS: {
                        static const uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
-                       le_uuid_enc(ent->ent_type, &zfs);
+                       uuid_enc_le(ent->ent_type, &zfs);
                        utf8_to_utf16((const uint8_t *)"FreeBSD ZFS partition",
                            ent->ent_name, 36);
                        break;
@@ -208,42 +208,42 @@
                        continue;
                case FS_SWAP: {
                        static const uuid_t swap = GPT_ENT_TYPE_NETBSD_SWAP;
-                       le_uuid_enc(ent->ent_type, &swap);
+                       uuid_enc_le(ent->ent_type, &swap);
                        utf8_to_utf16((const uint8_t *)"NetBSD swap partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_BSDFFS: {
                        static const uuid_t ufs = GPT_ENT_TYPE_NETBSD_FFS;
-                       le_uuid_enc(ent->ent_type, &ufs);
+                       uuid_enc_le(ent->ent_type, &ufs);
                        utf8_to_utf16((const uint8_t *)"NetBSD FFS partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_BSDLFS: {
                        static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_LFS;
-                       le_uuid_enc(ent->ent_type, &zfs);
+                       uuid_enc_le(ent->ent_type, &zfs);
                        utf8_to_utf16((const uint8_t *)"NetBSD LFS partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_RAID: {
                        static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_RAIDFRAME;
-                       le_uuid_enc(ent->ent_type, &zfs);
+                       uuid_enc_le(ent->ent_type, &zfs);
                        utf8_to_utf16((const uint8_t *)"NetBSD RAIDframe partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_CCD: {
                        static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_CCD;
-                       le_uuid_enc(ent->ent_type, &zfs);
+                       uuid_enc_le(ent->ent_type, &zfs);
                        utf8_to_utf16((const uint8_t *)"NetBSD CCD partition",
                            ent->ent_name, 36);
                        break;
                }
                case FS_CGD: {
                        static const uuid_t zfs = GPT_ENT_TYPE_NETBSD_CGD;
-                       le_uuid_enc(ent->ent_type, &zfs);
+                       uuid_enc_le(ent->ent_type, &zfs);
                        utf8_to_utf16((const uint8_t *)"NetBSD CGD partition",
                            ent->ent_name, 36);
                        break;
@@ -351,13 +351,13 @@
         * XXX struct gpt_hdr is not a multiple of 8 bytes in size and thus
         * contains padding we must not include in the size.
         */
-       hdr->hdr_size = htole32(GPT_SIZE);
+       hdr->hdr_size = htole32(GPT_HDR_SIZE);
        hdr->hdr_lba_self = htole64(gpt->map_start);
        hdr->hdr_lba_alt = htole64(tpg->map_start);
        hdr->hdr_lba_start = htole64(tbl->map_start + blocks);
        hdr->hdr_lba_end = htole64(lbt->map_start - 1LL);
        uuid_create(&uuid, NULL);
-       le_uuid_enc(hdr->hdr_uuid, &uuid);
+       uuid_enc_le(hdr->hdr_guid, &uuid);
        hdr->hdr_lba_table = htole64(tbl->map_start);
        hdr->hdr_entries = htole32((blocks * secsz) / sizeof(struct gpt_ent));
        if (le32toh(hdr->hdr_entries) > parts)
@@ -367,7 +367,7 @@
        ent = tbl->map_data;
        for (i = 0; i < le32toh(hdr->hdr_entries); i++) {
                uuid_create(&uuid, NULL);
-               le_uuid_enc(ent[i].ent_uuid, &uuid);
+               uuid_enc_le(ent[i].ent_guid, &uuid);
        }



Home | Main Index | Thread Index | Old Index