[LTP] [PATCH 1/2] lib/tst_mkfs: new tst_mkfs_sized function for create appointed size fs

Cyril Hrubis chrubis@suse.cz
Wed Mar 9 18:43:37 CET 2016


Hi!
> Sure, it's OK for me. And I think if we call it *fs_size, maybe make the user
> feel confused. The truth is it's the count of blocks, and only used for some
> fs. So maybe we can call it *extra_opts, means used after device name?

That is true, well the 'man mkfs' is confusing as well since it looks
like the size argument is supported generally by mkfs binaries...

And we should call it extra_opt, since it's just one option.

> So I will do this patch:
> 
> 1. change tst_mkfs to 
> void safe_mkfs(const int lineno, const char *fname, const char *dev,
>                const char *fs_type, const char *const fs_opts[],
>                const char *extra_opts)
> 
> 2. add tst_mkfs into test.h:
> static inline void tst_mkfs(const int lineno, const char *fname, const char *dev,
>                              const char *fs_type, const char *const fs_opts[])
> {
>     safe_mkfs(lineno, fname, dev, fs_type, fs_opts, NULL);
> }
> 
> Does this you want?

Having two nearly identical *_mkfs() functions would be confusing as
well. I would have just changed the function prototype and fixed all the
testcases that use it (36 testcases if I'm counting right).

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list