[LTP] [PATCH 1/2] lib: tst_test: Add per filesystem mkfs and mount opts

Petr Vorel pvorel@suse.cz
Tue Jun 11 13:02:03 CEST 2024


Hi Martin, Cyril,

> Hi,
> a design note below.

...
> > + * @fss: A NULL type terminated array of per file system type options. If
> > + *       tst_test.all_filesystems is not set the array describes a list of
> > + *       file systems to test along with parameters to pass to mkfs and mount.
> > + *       If tst_test.all_filesystems is set the mkfs and mount options are
> > + *       taken from tst_test.fs unless there is an override for a given
> > + *       file system type defined in this array.

> I like the general idea but I don't see the point of having separate .fs and
> .fss. You could simply use .fss[0] for the same purpose as .fs.

Look at the second patch where it is used (quotactl08.c):

static struct tst_test test = {
	...
	.fs = {
		.mkfs_opts = (const char *const[]){
			"-O quota", NULL
		},
		.type = "ext4",
	},

So would you set it as array?

static struct tst_test test = {
	...
	.fss = (struct tst_fs[]){
		{
			.mkfs_opts = (const char *const[]){
				"-O quota", NULL
			},
			.type = "ext4",
		},
		{}
	},

It's a bit verbose, but maybe having separate .fs is slightly more confusing.

Also having only array, we could use .fs name for it.

Kind regards,
Petr


More information about the ltp mailing list