Files
zvfs/tests/ioengine_test/test_common.c
2026-03-09 07:53:06 +00:00

21 lines
413 B
C

#include "test_common.h"
#include <stdlib.h>
#include <string.h>
int alloc_aligned_buf(void **buf, size_t len) {
int rc = posix_memalign(buf, 4096, len);
if (rc != 0) {
return -rc;
}
memset(*buf, 0, len);
return 0;
}
void fill_pattern(uint8_t *buf, size_t len, uint8_t seed) {
size_t i = 0;
for (i = 0; i < len; i++) {
buf[i] = (uint8_t)(seed + (uint8_t)i);
}
}