From: Karel Zak <kzak@redhat.com>
To: Davidlohr Bueso <dave@gnu.org>
Cc: Petr Uzel <petr.uzel@suse.cz>, util-linux <util-linux@vger.kernel.org>
Subject: Re: [PATCH 1/3] fdisk: add guid
Date: Fri, 21 Sep 2012 13:12:53 +0200 [thread overview]
Message-ID: <20120921111253.GA18699@x2.net.home> (raw)
In-Reply-To: <1345550594.2664.5.camel@offbook>
On Tue, Aug 21, 2012 at 02:03:14PM +0200, Davidlohr Bueso wrote:
> fdisks/cfdisk.c | 2 +-
> fdisks/common.h | 16 ++++-
> fdisks/fdiskbsdlabel.h | 38 +++++-----
> fdisks/fdisksgilabel.c | 38 +++++-----
> fdisks/fdisksunlabel.c | 34 ++++----
> fdisks/i386_sys_types.c | 198 +++++++++++++++++++++++-----------------------
> 6 files changed, 169 insertions(+), 157 deletions(-)
[....]
> +
> +/* Globally unique identifier */
> +struct fdisk_guid {
> + uint32_t time_low;
> + uint16_t time_mid;
> + uint16_t time_hi_and_version;
> + uint8_t clock_seq_hi;
> + uint8_t clock_seq_low;
> + uint8_t node[6];
> +};
>
> struct systypes {
> - unsigned char type;
> - char *name;
> + uint16_t type;
> + struct fdisk_guid guid;
> + const char *name;
> };
I don't like this hack. On all places in fdisk where we need systypes
is available fdisk_context struct where is ideal place to store label
specific stuff (ideally by any label specific function in fdisk_label).
> #ifdef DKTYPENAMES
> static struct systypes xbsd_fstypes[] = {
> - {BSD_FS_UNUSED, "unused"},
> - {BSD_FS_SWAP, "swap"},
> - {BSD_FS_V6, "Version 6"},
> - {BSD_FS_V7, "Version 7"},
> - {BSD_FS_SYSV, "System V"},
> - {BSD_FS_V71K, "4.1BSD"},
> - {BSD_FS_V8, "Eighth Edition"},
> - {BSD_FS_BSDFFS, "4.2BSD"},
it's really strange to modify BSD or DOS stuff when we need to add
GPT. All what we need is to move this stuff to label specific files
and make generic API for the structs. It's better to to this work now
than modify all the entries and later fix the API.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2012-09-21 11:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 12:03 [PATCH 1/3] fdisk: add guid Davidlohr Bueso
2012-09-21 11:12 ` Karel Zak [this message]
2012-09-21 11:25 ` Petr Uzel
2012-09-21 13:05 ` Davidlohr Bueso
2012-09-21 14:38 ` Karel Zak
2012-09-21 15:04 ` Davidlohr Bueso
2012-09-24 8:20 ` Karel Zak
2012-09-24 8:43 ` Karel Zak
2012-09-24 11:14 ` Davidlohr Bueso
2012-09-24 11:24 ` Davidlohr Bueso
2012-09-24 11:16 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120921111253.GA18699@x2.net.home \
--to=kzak@redhat.com \
--cc=dave@gnu.org \
--cc=petr.uzel@suse.cz \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).