From: Karel Zak <kzak@redhat.com>
To: Petr Uzel <petr.uzel@suse.cz>
Cc: util-linux <util-linux@vger.kernel.org>, dave@gnu.org
Subject: Re: [PATCH 1/5] fdisk: make grain global variable part of fdisk_context()
Date: Thu, 26 Jul 2012 17:07:28 +0200 [thread overview]
Message-ID: <20120726150728.GF21901@x2.net.home> (raw)
In-Reply-To: <1343311468-20206-1-git-send-email-petr.uzel@suse.cz>
On Thu, Jul 26, 2012 at 04:04:24PM +0200, Petr Uzel wrote:
> There is no reason for this to be global variable - it belongs
> to the context.
Yes. Applied, thanks.
> diff --git a/fdisks/utils.c b/fdisks/utils.c
> index 19aed87..9b69de3 100644
> --- a/fdisks/utils.c
> +++ b/fdisks/utils.c
> @@ -488,6 +488,8 @@ struct fdisk_context *fdisk_new_context_from_filename(const char *fname, int rea
> __discover_topology(cxt);
> __discover_system_geometry(cxt);
>
> + cxt->grain = DEFAULT_SECTOR_SIZE;
> +
This is unnecessary now, we call update_sector_offset() here. IMHO this
function should be modified to contains non-DOS stuff only and
renamed to update_alignment_info().
But it would be nice to add label specific update_alignment() to
fdisk_label struct. For DOS compatible mode we can set sector_offset
and grain there.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2012-07-26 15:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 14:04 [PATCH 1/5] fdisk: make grain global variable part of fdisk_context() Petr Uzel
2012-07-26 14:04 ` [PATCH 2/5] fdisk: fix typo Petr Uzel
2012-07-26 15:19 ` Karel Zak
2012-07-26 14:04 ` [PATCH 3/5] fdisk: always print total number of sectors Petr Uzel
2012-07-26 15:20 ` Karel Zak
2012-07-26 14:04 ` [PATCH 4/5] fdisk: don't print CHS geometry unless DOS compatible mode is set Petr Uzel
2012-07-26 15:21 ` Karel Zak
2012-07-26 14:04 ` [PATCH 5/5] tests: update fdisk test (default output format changed) Petr Uzel
2012-07-26 15:21 ` Karel Zak
2012-07-26 15:07 ` Karel Zak [this message]
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=20120726150728.GF21901@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).