if (td_read(td)) {
if (glfs_lstat(g->fs, f->file_name, &sb)
|| sb.st_size < f->real_file_size) {
- dprint(FD_FILE, "fio extend file %s from %ld to %ld\n",
- f->file_name, sb.st_size, f->real_file_size);
+ dprint(FD_FILE, "fio extend file %s from %jd to %" PRIu64 "\n",
+ f->file_name, (intmax_t) sb.st_size, f->real_file_size);
ret = glfs_ftruncate(g->fd, f->real_file_size);
if (ret) {
- log_err("failed fio extend file %s to %ld\n",
+ log_err("failed fio extend file %s to %" PRIu64 "\n",
f->file_name, f->real_file_size);
} else {
unsigned long long left;
r = glfs_write(g->fd, b, bs, 0);
dprint(FD_IO,
- "fio write %d of %ld file %s\n",
+ "fio write %d of %" PRIu64 " file %s\n",
r, f->real_file_size,
f->file_name);
struct io_u *io_u = data;
struct fio_gf_iou *iou = io_u->engine_data;
- dprint(FD_IO, "%s ret %lu\n", __FUNCTION__, ret);
+ dprint(FD_IO, "%s ret %zd\n", __FUNCTION__, ret);
iou->io_complete = 1;
}
#include "os/os.h"
#include "hash.h"
#include "lib/axmap.h"
-#include "lib/memalign.h"
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
{
int new_layout = 0, unlink_file = 0, flags;
unsigned long long left;
- unsigned int bs, alloc_size = 0;
+ unsigned int bs;
char *b = NULL;
if (read_only) {
flags |= O_CREAT;
if (new_layout)
flags |= O_TRUNC;
- if (td->o.odirect)
- flags |= OS_O_DIRECT;
#ifdef WIN32
flags |= _O_BINARY;
if (err == ENOENT && !td->o.allow_create)
log_err("fio: file creation disallowed by "
"allow_file_create=0\n");
- else {
- if (err == EINVAL && (flags & OS_O_DIRECT))
- log_err("fio: looks like your filesystem "
- "does not support "
- "direct=1/buffered=0\n");
-
+ else
td_verror(td, err, "open");
- }
return 1;
}
}
}
- if (td->o.odirect && !OS_O_DIRECT && fio_set_directio(td, f))
- goto err;
-
left = f->real_file_size;
bs = td->o.max_bs[DDIR_WRITE];
if (bs > left)
bs = left;
- alloc_size = bs;
- b = fio_memalign(page_size, alloc_size);
+ b = malloc(bs);
if (!b) {
- td_verror(td, errno, "fio_memalign");
+ td_verror(td, errno, "malloc");
goto err;
}
f->io_size = f->real_file_size;
}
- fio_memfree(b, alloc_size);
+ free(b);
done:
return 0;
err:
close(f->fd);
f->fd = -1;
if (b)
- fio_memfree(b, alloc_size);
+ free(b);
return 1;
}