lib/tst_device: Fill a file in megabyte sized chunks
PATCH 1/1 lib/tst_device: Fill a file in megabyte sized chunks
A zero-filled file is used as backing store when creating a loopback device. The zero-fill operations is done in 1KB sized chunks for file-size specified in megabytes. This leads to a large number of write calls which take long time during test setup phase in certain environments.
Move to using 1MB sized chunks to reduce the number of write syscalls by a few order of magnitude.
Signed-off-by Punit Agrawal <[email protected]>
--- lib/tst_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tst_device.c +1 -1
@@ -268,7 +268,7 @@ const char *tst_acquire_device__(unsigned int size) ltp_dev_size, acq_dev_size); } -if (tst_fill_file (DEV_FILE ,0 ,1024 ,1024 * acq_dev_size)) { +if (tst_fill_file (DEV_FILE ,0 ,1024 *1024 , acq_dev_size)) {tst_resm (TWARN |TERRNO ,"Failed to create " DEV_FILE );return NULL ; }
Signature · 1 line
2.17.0
PATCH 1/1 lib/tst_device: Fill a file in megabyte sized chunks
Hi!
Pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]