[LTP] [PATCH v2 1/2] OVL_MNT: add setup_overlay helper

Petr Vorel pvorel@suse.cz
Fri May 24 14:23:57 CEST 2019


Hi Amir,

thanks for your suggestions, highly appreciated :).
...
> > #define SAFE_MOUNT_OVERLAY() \
> >         mount_overlay(__FILE__, __LINE__, 1);

> > #define TST_MOUNT_OVERLAY() \
> >         mount_overlay(__FILE__, __LINE__, 0);


> I like this version of the helpers/macros.

> I would change TST_MOUNT_OVERLAY to
> (mount_overlay(__FILE__, __LINE__, 0) == 0)
> so that it could be used like this:

> ovl_mounted = TST_MOUNT_OVERLAY(...)
+1

> Uses of SAFE_MOUNT_OVERLAY() should not check return value
> could even place (void) in front of mount_overlay to enforce that.
If we don't care, then it could be?
#define SAFE_MOUNT_OVERLAY() \
	(void) mount_overlay(__FILE__, __LINE__, 1);

I mean there is always mount_overlay() for special cases, macros should be
here to make easier common usage.

> Test that use SAFE_MOUNT_OVERLAY() should either have no
> variable ovl_mounted or set it after SAFE_MOUNT_OVERLAY() without
> checking return value.
+1

> Thanks,
> Amir.

Kind regards,
Petr


More information about the ltp mailing list