From: Dave Chinner <david@fromorbit.com>
To: "Luis R. Rodriguez" <mcgrof@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org,
darrick.wong@oracle.com, jack@suse.com, jeffm@suse.com,
okurz@suse.com, lpechacek@suse.com, jtulak@redhat.com
Subject: Re: [PATCH v2 3/5] mkfs: replace defaults source with an enum
Date: Fri, 18 May 2018 10:53:16 +1000 [thread overview]
Message-ID: <20180518005316.GH23861@dastard> (raw)
In-Reply-To: <20180517230918.GA24680@garbanzo.do-not-panic.com>
On Thu, May 17, 2018 at 04:09:18PM -0700, Luis R. Rodriguez wrote:
> On Fri, May 18, 2018 at 08:48:49AM +1000, Dave Chinner wrote:
> > On Thu, May 17, 2018 at 12:26:58PM -0700, Luis R. Rodriguez wrote:
> > > Using an enum will let us later just use a switch statement to print
> > > out the source, this makes sources easier to document, update and
> > > manage.
> > >
> > > Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
> >
> > This is incomplete. :(
>
> It builds, the comment was intentional.
That doesn't make it complete. Usually when introducing new code one
part at a time, the entire functionality of that part is separated
out so it can be reviewed whole, not split across multilple patches
and intermingled with other new functionality....
> > > /*
> > > * Default filesystem features and configuration values
> > > *
> > > @@ -49,7 +60,7 @@ struct sb_feat_args {
> > > * calculations.
> > > */
> > > struct mkfs_default_params {
> > > - char *source; /* where the defaults came from */
> > > + enum default_params_type type; /* where the defaults came from */
> > >
> > > int sectorsize;
> > > int blocksize;
> >
> > As it is, I don't see why this change it necessary - you can just
> > store the appropriate string (as the code currently does) into the
> > structure once the source is known. Why do we need infrastructure to
> > abstract printing a string when we set it directly, anyway?
>
> Using an enum we get to document the different sources clearly, and we
> also get to have an enum to compare against for conditionals later,
> instead of having to strcmp().
See my comments in later patches, where I suggest all that gets
removed because i don't think it works. :P
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2018-05-18 0:53 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 19:26 [PATCH v2 0/5] xfsprogs: add mkfs.xfs configuration file parsing support Luis R. Rodriguez
2018-05-17 19:26 ` [PATCH v2 1/5] mkfs: distinguish between struct sb_feat_args and struct cli_params Luis R. Rodriguez
2018-05-17 22:02 ` Dave Chinner
2018-05-17 19:26 ` [PATCH v2 2/5] mkfs: move shared structs and cli params into their own headers Luis R. Rodriguez
2018-05-17 22:40 ` Dave Chinner
2018-05-17 23:54 ` Luis R. Rodriguez
2018-05-18 0:49 ` Dave Chinner
2018-05-19 1:33 ` Luis R. Rodriguez
2018-05-17 19:26 ` [PATCH v2 3/5] mkfs: replace defaults source with an enum Luis R. Rodriguez
2018-05-17 22:48 ` Dave Chinner
2018-05-17 23:09 ` Luis R. Rodriguez
2018-05-18 0:53 ` Dave Chinner [this message]
2018-05-17 19:26 ` [PATCH v2 4/5] mkfs: add helpers to process defaults Luis R. Rodriguez
2018-05-17 22:53 ` Dave Chinner
2018-05-18 0:06 ` Luis R. Rodriguez
2018-05-17 19:27 ` [PATCH v2 5/5] mkfs.xfs: add configuration file parsing support using our own parser Luis R. Rodriguez
2018-05-17 21:31 ` Darrick J. Wong
2018-05-18 0:29 ` Luis R. Rodriguez
2018-05-21 18:32 ` Luis R. Rodriguez
2018-05-18 0:44 ` Dave Chinner
2018-05-19 1:32 ` Luis R. Rodriguez
2018-05-21 0:14 ` Dave Chinner
2018-05-21 15:30 ` Darrick J. Wong
2018-05-21 16:58 ` Luis R. Rodriguez
2018-05-22 19:37 ` Luis R. Rodriguez
2018-05-18 3:24 ` Eric Sandeen
2018-05-18 3:46 ` Darrick J. Wong
2018-05-18 15:38 ` Luis R. Rodriguez
2018-05-18 17:09 ` Eric Sandeen
2018-05-18 23:56 ` Luis R. Rodriguez
2018-05-21 9:40 ` Jan Tulak
2018-05-25 0:50 ` Luis R. Rodriguez
2018-05-20 0:16 ` Dave Chinner
2018-05-21 15:33 ` Darrick J. Wong
2018-05-21 17:05 ` Luis R. Rodriguez
2018-05-21 22:10 ` Dave Chinner
2018-05-21 22:24 ` Eric Sandeen
2018-05-22 0:38 ` Dave Chinner
2018-05-25 0:51 ` Luis R. Rodriguez
2018-05-25 0:54 ` Luis R. Rodriguez
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=20180518005316.GH23861@dastard \
--to=david@fromorbit.com \
--cc=darrick.wong@oracle.com \
--cc=jack@suse.com \
--cc=jeffm@suse.com \
--cc=jtulak@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=lpechacek@suse.com \
--cc=mcgrof@kernel.org \
--cc=okurz@suse.com \
--cc=sandeen@sandeen.net \
/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