Some versions of the kernel will create bounce buffers instead of using
directly if the user buffer is not aligned.
Signed-off-by: Keith Busch <keith.busch@intel.com>
if (cfg.metadata_len)
metadata = malloc(cfg.metadata_len);
if (cfg.data_len) {
- data = malloc(cfg.data_len);
- if (!data)
+ if (posix_memalign(&data, getpagesize(), cfg.data_len))
exit(ENOMEM);
+
memset(data, cfg.prefill, cfg.data_len);
if (!cfg.read && !cfg.write) {
fprintf(stderr, "data direction not given\n");