From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/7] mkfs: support arbitrary conflict specification
Date: Wed, 20 Dec 2017 14:52:27 +1100 [thread overview]
Message-ID: <20171220035227.GD4094@dastard> (raw)
In-Reply-To: <20171220025346.GL12613@magnolia>
On Tue, Dec 19, 2017 at 06:53:46PM -0800, Darrick J. Wong wrote:
> On Mon, Dec 18, 2017 at 08:11:55PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Currently the conflict table is a single dimension, allowing
> > conflicts to be specified in the same option table. however, we
> > have conflicts that span option tables (e.g. sector size) and
> > so we need to encode both the table and the option that conflicts.
> >
> > Add support for a two dimensional conflict definition and convert
> > all the code over to use it.
> >
> > Signed-Off-By: Dave Chinner <dchinner@redhat.com>
> > ---
> > mkfs/xfs_mkfs.c | 257 ++++++++++++++++++++++++++++----------------------------
> > 1 file changed, 130 insertions(+), 127 deletions(-)
> >
> > diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> > index 7cc5ee2ddb9d..2272700807dc 100644
> > --- a/mkfs/xfs_mkfs.c
> > +++ b/mkfs/xfs_mkfs.c
> > @@ -125,7 +125,10 @@ struct opt_params {
> > bool str_seen;
> > bool convert;
> > bool is_power_2;
> > - int conflicts[MAX_CONFLICTS];
> > + struct _conflict {
> > + struct opt_params *opts;
> > + int subopt;
> > + } conflicts[MAX_CONFLICTS];
> > long long minval;
> > long long maxval;
> > long long defaultval;
> > @@ -143,8 +146,8 @@ struct opt_params bopts = {
> > },
> > .subopt_params = {
> > { .index = B_LOG,
> > - .conflicts = { B_SIZE,
> > - LAST_CONFLICT },
> > + .conflicts = { { &bopts, B_SIZE },
> > + { &bopts, LAST_CONFLICT } },
>
> Hmm. The LAST_CONFLICT entry doesn't require an *opts pointer, right?
>
> It feels a little funny to me that the last entry isn't:
>
> { NULL, LAST_CONFLICT }
>
> ...since we're not actually doing anything with bopts in that last
> entry, but that might be a matter of taste (aka I punt to sandeen) :)
Doesn't worry me - I put it there as the loop terminates on
LAST_CONFLICT, not on a null opts pointer. Eric - up to you.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2017-12-20 3:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-18 9:11 [PATCH 0/7] mkfs: various cleanups Dave Chinner
2017-12-18 9:11 ` [PATCH 1/7] mkfs: use opts parameter during option parsing Dave Chinner
2017-12-20 2:47 ` Darrick J. Wong
2017-12-18 9:11 ` [PATCH 2/7] mkfs: simplify minimum log size calculation Dave Chinner
2017-12-20 3:02 ` Darrick J. Wong
2017-12-18 9:11 ` [PATCH 3/7] mkfs: protofile only needs to be set up once Dave Chinner
2017-12-20 2:48 ` Darrick J. Wong
2017-12-18 9:11 ` [PATCH 4/7] mkfs: support arbitrary conflict specification Dave Chinner
2017-12-20 2:53 ` Darrick J. Wong
2017-12-20 3:52 ` Dave Chinner [this message]
2017-12-24 20:45 ` Eric Sandeen
2017-12-28 21:45 ` Eric Sandeen
2017-12-18 9:11 ` [PATCH 5/7] mkfs: convert subopt name,val pairs to enums and declared arrays Dave Chinner
2017-12-20 2:56 ` Darrick J. Wong
2017-12-18 9:11 ` [PATCH 6/7] mkfs: resolve sector size CLI conflicts Dave Chinner
2017-12-20 2:59 ` Darrick J. Wong
2017-12-20 3:56 ` Dave Chinner
2017-12-28 21:36 ` Eric Sandeen
2017-12-18 9:11 ` [PATCH 7/7] mkfs: remove logarithm based CLI options Dave Chinner
2017-12-20 3:01 ` Darrick J. Wong
2017-12-20 4:01 ` Dave Chinner
2017-12-20 5:21 ` Darrick J. Wong
2017-12-28 21:35 ` Eric Sandeen
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=20171220035227.GD4094@dastard \
--to=david@fromorbit.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.