[LTP] [PATCH v2 1/2] lib: tst_test: Add per filesystem mkfs and mount opts
Avinesh Kumar
akumar@suse.de
Mon Jun 17 19:37:17 CEST 2024
Hi,
> /**
> * struct tst_test - A test description.
> *
> @@ -377,29 +407,22 @@ struct tst_ulimit_val {
> *
> * @dev_min_size: A minimal device size in megabytes.
> *
> - * @dev_fs_type: If set overrides the default file system type for the device and
> - * sets the tst_device.fs_type.
* @format_device: Does all tst_test.needs_device would do and also formats
* the device with tst_test.dev_fs_type file system as well.
We should also update 'format_device' documentation according to these changes.
> - *
> - * @dev_fs_opts: A NULL terminated array of options passed to mkfs in the case
> - * of 'tst_test.format_device'. These options are passed to mkfs
> - * before the device path.
> - *
...
...
> @@ -1160,6 +1160,38 @@ static void set_ulimit_(const char *file, const int lineno, const struct tst_uli
> safe_setrlimit(file, lineno, conf->resource, &rlim);
> }
>
> +static unsigned int count_fs_descs(void)
> +{
> + unsigned int ret = 0;
> +
> + if (!tst_test->filesystems)
> + return 0;
> +
> + /*
> + * First entry is special, if it has zero type is the it's the default
this sentence seems a bit off.
with these,
Reviewed-by: Avinesh Kumar <akumar@suse.de>
for both patches.
> + * entry and is either followed by a terminating entry or by filesystem
> + * description(s) plus terminating entry.
> + */
> + if (!tst_test->filesystems[0].type)
> + ret = 1;
> +
> + while (tst_test->filesystems[ret].type)
> + ret++;
> +
> + return ret;
> +}
> +
Regards,
Avinesh
More information about the ltp
mailing list