Re: [PATCH 4/7] mkfs: support arbitrary conflict specification

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

 



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@xxxxxxxxxx>
> > 
> > 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@xxxxxxxxxx>
> > ---
> >  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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux