[LTP] [PATCH v1] swapoff01.c: Adjust blocks size base on pagesize

Petr Vorel pvorel@suse.cz
Fri Feb 23 09:32:12 CET 2024


Hi all,

> Hi Wei, Cyril,


> > > I do not think that this is a right solution though. Is there any reason
> > > why we pass number of blocks to the make_swapfile instead of megabytes?

> > @Li Wang, could you give some clue for above question(for why pass number
> > of blocks instead of megabytes)?


> I just keep the function interface like the original
> (it wasn't designed by me:), but I guess the only
> advantage is to test 1 block for different FS types.

We use this function with 1 block, 10 blocks and 65536 blocks

How about to have special function for 1 block and then other function which
accepts MB? (e.g. 1 MB and 256 MB)?

But could we first merge Yang Xu patchset so that he does not have to rebase it
for ever?

https://patchwork.ozlabs.org/project/ltp/list/?series=395713&state=*

Also it'd be nice to have, but this can definitely wait after other things are
solved.

-int make_swapfile(const char *swapfile, int blocks, int safe)
+int _make_swapfile(const char *swapfile, int blocks, int safe)

+#define MAKE_SWAPFILE(const char *swapfile, int blocks, int safe) \
+	_make_swapfile(swapfile, blocks, 0)

+#define SAFE_SWAPFILE(const char *swapfile, int blocks, int safe) \
+	_make_swapfile(swapfile, blocks, 1)

Kind regards,
Petr


More information about the ltp mailing list