Re: [PATCH v5 05/17] xfs: mount-api - refactor suffix_kstrtoint()

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

 



On Wed, Oct 09, 2019 at 04:21:27PM +0100, Al Viro wrote:
> What we need to do is to turn fs_parameter_type into a pointer
> to function.  With fs_param_is_bool et.al. becoming instances
> of such, and fs_parse() switch from hell turning into
> 	err = p->type(p, param, result);
> 
> That won't affect the existing macros or any filesystem code.
> If some filesystem wants to have helpers of its own - more
> power to it, just use __fsparam(my_bloody_helper, "foo", Opt_foo, 0)
> and be done with that.

Actually, while we could keep the old macros around at least
temporarily for existing users I think killing them actually would
improve the file systems as well.

This:

static const struct fs_parameter_spec afs_param_specs[] = {
	{ "autocell",	Opt_autocell,	fs_parse_flag },
	{ "dyn",	Opt_dyn,	fs_parse_flag },
	{ "flock",	Opt_flock,	fs_parse_enum },
	{ "source",	Opt_source,	fs_parse_string },
        {}
};


is a lot more obvious than:

static const struct fs_parameter_spec afs_param_specs[] = {
        fsparam_flag  ("autocell",      Opt_autocell),
        fsparam_flag  ("dyn",           Opt_dyn),
        fsparam_enum  ("flock",         Opt_flock),
        fsparam_string("source",        Opt_source),
        {}
};



[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