projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
verify: fix problem with hole punching on newer Linux kernels
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 37ea75283e0a52af68dd573e91096ccf6943e5fb..7d3a0613b8296eb5a5f2d08c268a261fd8b1561c 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-127,7
+127,6
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
}
b = malloc(td->o.max_bs[DDIR_WRITE]);
}
b = malloc(td->o.max_bs[DDIR_WRITE]);
- memset(b, 0, td->o.max_bs[DDIR_WRITE]);
left = f->real_file_size;
while (left && !td->terminate) {
left = f->real_file_size;
while (left && !td->terminate) {
@@
-135,6
+134,8
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
if (bs > left)
bs = left;
if (bs > left)
bs = left;
+ fill_io_buffer(td, b, bs, bs);
+
r = write(f->fd, b, bs);
if (r > 0) {
r = write(f->fd, b, bs);
if (r > 0) {
@@
-355,7
+356,8
@@
static int get_file_size(struct thread_data *td, struct fio_file *f)
if (f->file_offset > f->real_file_size) {
log_err("%s: offset extends end (%llu > %llu)\n", td->o.name,
if (f->file_offset > f->real_file_size) {
log_err("%s: offset extends end (%llu > %llu)\n", td->o.name,
- f->file_offset, f->real_file_size);
+ (unsigned long long) f->file_offset,
+ (unsigned long long) f->real_file_size);
return 1;
}
return 1;
}
@@
-386,7
+388,8
@@
static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
if (f->mmap_ptr) {
ret = posix_madvise(f->mmap_ptr, f->mmap_sz, POSIX_MADV_DONTNEED);
#ifdef FIO_MADV_FREE
if (f->mmap_ptr) {
ret = posix_madvise(f->mmap_ptr, f->mmap_sz, POSIX_MADV_DONTNEED);
#ifdef FIO_MADV_FREE
- (void) posix_madvise(f->mmap_ptr, f->mmap_sz, FIO_MADV_FREE);
+ if (f->filetype == FIO_TYPE_BD)
+ (void) posix_madvise(f->mmap_ptr, f->mmap_sz, FIO_MADV_FREE);
#endif
} else if (f->filetype == FIO_TYPE_FILE) {
ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);
#endif
} else if (f->filetype == FIO_TYPE_FILE) {
ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);