[LTP] [PATCH] lib: tst_device: Allow more control over the device size

Cyril Hrubis chrubis@suse.cz
Mon Aug 2 14:14:43 CEST 2021


Hi!
> The usage of foo foo_ and foo__ does not really help in reading the code :)
> There could also be some logic errors hiding, e.g. 
> tst_acquire_loop_device should probably not default to DEV_SIZE_MB at all.
> The caller should be responsible for finding a correct size and the two 
> users of this function (tst_device [the binary] and 
> tst_acquire_device__) do pass a concrete value for size.

Actually the tst_device binary does not pass a concrete size unless the
shell code that calls it passes an optional parameter, so the fallback
to DEV_SIZE_MB if size == 0 has to stay in the double underscore
function. I will send a v2 that just replaces the second occurence of
MAX() in tst_device.c for now as it looks to me that any singificant
cleanup would require complete redesing of the interface and quite
possibly rewrite of the last 16 tests that use the old API as a
pre-requisite.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list